Package analyzer

Examples of analyzer.SyntaxTree


  /*
   * producao de um termo para expressao
   */
  private SyntaxTree term(){
   
    SyntaxTree node = this.factor();
    TokenType.Element type = this.currentToken.getType();
   
    while( type == TokenType.Element.MULTIPLICATION || type == TokenType.Element.DIVISION ){
     
      SyntaxTree child = new SyntaxTree( SyntaxType.Tree.EXPRESSION, SyntaxType.ExpressionKind.OPERATION, this.currentToken );
      child.appendChild( node );
      node = child;
      this.match( type );
      child.appendChild( this.factor() );
     
      type = this.currentToken.getType();
    }
   
    return node;
View Full Code Here


  /*
   * producao de um fator para termo
   */
  private SyntaxTree factor(){
   
    SyntaxTree node = null;
    TokenType.Element type = this.currentToken.getType();
   
    switch( type ){
   
      case NUMBER:
        node = new SyntaxTree( SyntaxType.Tree.EXPRESSION, SyntaxType.ExpressionKind.CONSTANT, this.currentToken );
        this.match( type );
        break;
       
      case IDENTIFIER:
        node = new SyntaxTree( SyntaxType.Tree.EXPRESSION, SyntaxType.ExpressionKind.IDENTIFIER, this.currentToken );
        this.match( type );
        break;
       
      case LEFT_BRACKET:
        this.match( type );
View Full Code Here

TOP

Related Classes of analyzer.SyntaxTree

Copyright © 2018 www.massapicom. 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.