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:
@@ -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
|
||||
|
Reference in New Issue
Block a user