Parse() public method

public Parse ( ) : LNode
return LNode
Beispiel #1
0
        void TestStage1Core(string text, LNode expected)
        {
            var   lexer     = ParsingService.Default.Tokenize(text, ConsoleMessageSink.Value);
            var   treeified = new TokensToTree(lexer, true);
            var   tokens    = treeified.Buffered();
            var   parser    = new StageOneParser(tokens, lexer.SourceFile, ConsoleMessageSink.Value);
            LNode result    = parser.Parse();

            AreEqual(expected, result);
        }
Beispiel #2
0
 public static LNode Parse(IListSource <Token> tokenTree, ISourceFile file, IMessageSink messages)
 {
     if (_parser == null)
     {
         _parser = new StageOneParser(tokenTree, file, messages);
     }
     else
     {
         _parser.Reset(tokenTree, file);
         _parser.ErrorSink = messages;
     }
     return(_parser.Parse());
 }
Beispiel #3
0
 public static LNode ParseTokenTree(TokenTree tokens, IMessageSink sink, LNode basis)
 {
     return(StageOneParser.Parse(tokens, tokens.File, sink));
 }
Beispiel #4
0
		void TestStage1Core(string text, LNode expected)
		{
			var lexer = ParsingService.Default.Tokenize(text, ConsoleMessageSink.Value);
			var treeified = new TokensToTree(lexer, true);
			var tokens = treeified.Buffered();
			var parser = new StageOneParser(tokens, lexer.SourceFile, ConsoleMessageSink.Value);
			LNode result = parser.Parse();
			AreEqual(expected, result);
		}