feat: CanonSharp Benchmark. (#4)

Reviewed-on: https://git.bupt-hpc.cn/jackfiled/CanonSharp/pulls/4
Co-authored-by: jackfiled <xcrenchangjun@outlook.com>
Co-committed-by: jackfiled <xcrenchangjun@outlook.com>
This commit is contained in:
2024-08-19 14:37:34 +08:00
committed by 任昌骏
parent cf19f8197e
commit 89ce313b77
165 changed files with 11578 additions and 0 deletions

View File

@@ -8,6 +8,13 @@ namespace CanonSharp.Pascal.Parser;
public sealed class GrammarParser : GrammarParserBuilder
{
public Program Parse(IEnumerable<LexicalToken> tokens)
{
IParseResult<LexicalToken, Program> result = ProgramParser().Parse(new LexicalTokenReadState(tokens));
return result.Value;
}
public static IParser<LexicalToken, SyntaxNodeBase> FactorParser()
{
// factor -> - factor | + factor