예제 #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));
        }