public void visit(SFNode field) { VRML97Token token = context.PeekNextToken(); switch (token.Text) { case "NULL": field.Node = null; break; default: context.PushNodeContainer(field); nodeStatementParser(context); context.PopNodeContainer(); break; } }
public void Parse(MFNode container) { var context = new ParserContext(_tokenizer); try { _fieldParser = new FieldParser(context, ParseNodeStatement); context.PushNodeContainer(container); ParseStatements(context); context.PopNodeContainer(); } catch (VrmlParseException exc) { throw new InvalidVRMLSyntaxException(exc.Message + " at Line: " + context.LineIndex + " Column: " + context.ColumnIndex); } }
protected virtual void ParseProto(ParserContext context) { context.ReadKeyword("PROTO"); var proto = new ProtoNode { name = ParseNodeNameId(context) }; context.PushNodeContainer(proto.children); context.PushFieldContainer(proto); ParseInterfaceDeclarations(context); if (context.ReadNextToken().Type != VRML97TokenType.OpenBrace) { throw new InvalidVRMLSyntaxException(); } ParseProtoBody(context); if (context.ReadNextToken().Type != VRML97TokenType.CloseBrace) { throw new InvalidVRMLSyntaxException(); } context.PopFieldContainer(); context.PopNodeContainer(); context.RegisterPtototype(proto); }