pl.edu.pjwstk.yaod.yaql.abstractsyntaxtree.statements
Class IfElseStatement

java.lang.Object
  |
  +--pl.edu.pjwstk.yaod.yaql.abstractsyntaxtree.AbstractSyntaxTree
        |
        +--pl.edu.pjwstk.yaod.yaql.abstractsyntaxtree.Statement
              |
              +--pl.edu.pjwstk.yaod.yaql.abstractsyntaxtree.statements.IfElseStatement
All Implemented Interfaces:
java.io.Serializable

public class IfElseStatement
extends Statement

The IfElseStatement class represents the statement nodes in the abstract syntax tree.

Author:
Jakub Trzetrzelewski, jakub_trzetrzelewski@yahoo.com
See Also:
Serialized Form

Field Summary
 Expression e
           
 KeywordTerminal lk
           
 KeywordTerminal rk
           
 Statement s1
           
 Statement s2
           
 
Constructor Summary
IfElseStatement(Expression e, Statement s1, Statement s2, KeywordTerminal lk, KeywordTerminal rk)
          Creates a new statement node with the given expression e statements s1 and s2 and terminals lk rk.
 
Method Summary
 void accept(Visitor v)
          Method responsible for traversing the abstract syntax tree structure.
 java.lang.String getSpellingAndPosition()
          Returns the spelling and positions of all terminals in a node.
 java.lang.String getTypeAsString()
          Returns the abstract syntax tree node type as a string value.
 void show(java.lang.String st)
          Method responsible for displaying the statement node.
 
Methods inherited from class pl.edu.pjwstk.yaod.yaql.abstractsyntaxtree.AbstractSyntaxTree
getLongestTypeAsSpacesString, getPreparedTypeAsString, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

e

public Expression e

s1

public Statement s1

s2

public Statement s2

lk

public KeywordTerminal lk

rk

public KeywordTerminal rk
Constructor Detail

IfElseStatement

public IfElseStatement(Expression e,
                       Statement s1,
                       Statement s2,
                       KeywordTerminal lk,
                       KeywordTerminal rk)
Creates a new statement node with the given expression e statements s1 and s2 and terminals lk rk.
Parameters:
e - any expression.
s1 - any statement.
s2 - any statement.
lk - keyword terminal.
rk - keyword terminal.
Method Detail

getTypeAsString

public java.lang.String getTypeAsString()
Returns the abstract syntax tree node type as a string value.
Overrides:
getTypeAsString in class AbstractSyntaxTree
Returns:
the abstract syntax tree node type as string.

getSpellingAndPosition

public java.lang.String getSpellingAndPosition()
Returns the spelling and positions of all terminals in a node.
Overrides:
getSpellingAndPosition in class AbstractSyntaxTree
Returns:
the spelling and positions of all terminals in a node.

accept

public void accept(Visitor v)
            throws EvalException
Method responsible for traversing the abstract syntax tree structure.
Overrides:
accept in class AbstractSyntaxTree
Parameters:
v - the visitor.
Throws:
EvalException - if evaluation fails.
See Also:
Visitor

show

public void show(java.lang.String st)
Method responsible for displaying the statement node.
Overrides:
show in class AbstractSyntaxTree
Parameters:
st - the string which is an auxiliary tabulator.