示例#1
0
 private static Reply<CompilationUnit> Parse(string rookCode)
 {
     var tokens = new RookLexer().Tokenize(rookCode);
     return new RookGrammar().CompilationUnit.Parse(new TokenStream(tokens));
 }
示例#2
0
 public static Class ParseClass(this string source)
 {
     var tokens = new RookLexer().Tokenize(source);
     var parser = new RookGrammar().Class;
     return parser.Parse(new TokenStream(tokens)).Value;
 }
示例#3
0
        public static Reply <T> Parses <T>(this Parser <T> parser, string source)
        {
            var tokens = new RookLexer().Tokenize(source);

            return(parser.Parses(tokens));
        }