Beispiel #1
0
        public BaseNode[] createVrmlFromString(string vrmlSyntax)
        {
            Vrml97Tokenizer tokenizer = new Vrml97Tokenizer(new StringReader(vrmlSyntax));
            VrmlParser      parser    = new VrmlParser(tokenizer);
            MFNode          node      = new MFNode();

            parser.Parse(node);
            return(null);
        }
 private VrmlScene LoadScene(string name)
 {
     using (var stream = GetType().Assembly.GetManifestResourceStream(this.GetType(), name)) {
         var tokenizer = new Vrml97Tokenizer(stream);
         var parser    = new VrmlParser(tokenizer);
         var scene     = new VrmlScene();
         parser.Parse(scene);
         return(scene);
     }
 }
 public void TokenizerTest()
 {
     using (var stream = GetType().Assembly.GetManifestResourceStream(GetType(), "Ant.WRL")) {
         var tokenizer = new Vrml97Tokenizer(stream);
         int count     = 0;
         while (tokenizer.ReadNextToken().Type != VRML97TokenType.EOF)
         {
             count++;
         }
         Assert.AreEqual(39343, count, "Check node count");
     }
 }
Beispiel #4
0
 public VrmlParser(Vrml97Tokenizer tokenizer)
 {
     _tokenizer = tokenizer;
 }
 protected VrmlTokenizerState(TokenizerContext context)
 {
     this.context = context;
     this.tokenizer = context.Tokenizer;
 }
 public ParserContext(Vrml97Tokenizer tokenizer)
 {
     _tokenizer     = tokenizer;
     _nodeFactory   = new NodeFactory();
     _childAcceptor = new ChildAcceptor();
 }
Beispiel #7
0
 protected VrmlTokenizerState(TokenizerContext context)
 {
     this.context   = context;
     this.tokenizer = context.Tokenizer;
 }