public static ProgramNode Parse(Lexer lex) { ProgramNode n = new ProgramNode(); while (UsingNode.IsPresent(lex)) { n.Using.Add(UsingNode.Parse(lex)); } n.Namespace = NamespaceNode.Parse(lex); return(n); }
public static NamespaceNode Parse(Lexer lex) { var n = new NamespaceNode(); lex.Dequeue("namespace"); n.Identifier = TRefNode.Parse(lex); lex.Dequeue(TokenType.LBrace); while (SubdefNode.IsPresent(lex)) { n.Subdefinitions.Add(SubdefNode.Parse(lex)); } lex.Dequeue(TokenType.RBrace); return(n); }