Package org.antlr.runtime.tree

Examples of org.antlr.runtime.tree.CommonTreeNodeStream.consume()


    int indexOf104 = 6;
    stream.push(indexOf104);
    assertEquals(104, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 102
    assertEquals(Token.DOWN, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume DN
    assertEquals(105, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 103
    assertEquals(Token.UP, ((Tree)stream.LT(1)).getType());
    // RETURN (to UP node in 102 subtree)
    stream.pop();
View Full Code Here


    assertEquals(104, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 102
    assertEquals(Token.DOWN, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume DN
    assertEquals(105, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 103
    assertEquals(Token.UP, ((Tree)stream.LT(1)).getType());
    // RETURN (to UP node in 102 subtree)
    stream.pop();

    assertEquals(Token.UP, ((Tree)stream.LT(1)).getType());
View Full Code Here

    r0.addChild(new CommonTree(new CommonToken(109)));

    CommonTreeNodeStream stream = new CommonTreeNodeStream(r0);

    while ( stream.LA(1)!=Token.EOF ) {
      stream.consume();
    }
    int indexOf102 = 2;
    int indexOf104 = 6;
    assertEquals(Token.EOF, ((Tree)stream.LT(1)).getType());
View Full Code Here

    assertEquals(Token.EOF, ((Tree)stream.LT(1)).getType());

    // CALL 102
    stream.push(indexOf102);
    assertEquals(102, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 102
    assertEquals(Token.DOWN, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume DN
    assertEquals(103, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 103
    assertEquals(Token.UP, ((Tree)stream.LT(1)).getType());
View Full Code Here

    // CALL 102
    stream.push(indexOf102);
    assertEquals(102, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 102
    assertEquals(Token.DOWN, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume DN
    assertEquals(103, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 103
    assertEquals(Token.UP, ((Tree)stream.LT(1)).getType());
    // RETURN (to empty stack)
    stream.pop();
View Full Code Here

    assertEquals(102, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 102
    assertEquals(Token.DOWN, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume DN
    assertEquals(103, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 103
    assertEquals(Token.UP, ((Tree)stream.LT(1)).getType());
    // RETURN (to empty stack)
    stream.pop();
    assertEquals(Token.EOF, ((Tree)stream.LT(1)).getType());
View Full Code Here

    assertEquals(Token.EOF, ((Tree)stream.LT(1)).getType());

    // CALL 104
    stream.push(indexOf104);
    assertEquals(104, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 102
    assertEquals(Token.DOWN, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume DN
    assertEquals(105, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 103
    assertEquals(Token.UP, ((Tree)stream.LT(1)).getType());
View Full Code Here

    // CALL 104
    stream.push(indexOf104);
    assertEquals(104, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 102
    assertEquals(Token.DOWN, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume DN
    assertEquals(105, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 103
    assertEquals(Token.UP, ((Tree)stream.LT(1)).getType());
    // RETURN (to empty stack)
    stream.pop();
View Full Code Here

    assertEquals(104, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 102
    assertEquals(Token.DOWN, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume DN
    assertEquals(105, ((Tree)stream.LT(1)).getType());
    stream.consume(); // consume 103
    assertEquals(Token.UP, ((Tree)stream.LT(1)).getType());
    // RETURN (to empty stack)
    stream.pop();
    assertEquals(Token.EOF, ((Tree)stream.LT(1)).getType());
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.