net.sourceforge.nrl.parser.ast.impl
Class RuleFileImpl

java.lang.Object
  extended by org.antlr.runtime.tree.BaseTree
      extended by org.antlr.runtime.tree.CommonTree
          extended by net.sourceforge.nrl.parser.ast.impl.Antlr3NRLBaseAst
              extended by net.sourceforge.nrl.parser.ast.impl.RuleFileImpl
All Implemented Interfaces:
INRLAstNode, IRuleFile, org.antlr.runtime.tree.Tree

public class RuleFileImpl
extends Antlr3NRLBaseAst
implements IRuleFile

ANTLR implementation of the overall rule file AST node.

Author:
Christian Nentwich

Field Summary
 
Fields inherited from class org.antlr.runtime.tree.CommonTree
childIndex, parent, startIndex, stopIndex, token
 
Fields inherited from class org.antlr.runtime.tree.BaseTree
children
 
Fields inherited from interface net.sourceforge.nrl.parser.ast.INRLAstNode
NEWLINE
 
Fields inherited from interface org.antlr.runtime.tree.Tree
INVALID_NODE
 
Constructor Summary
RuleFileImpl()
           
RuleFileImpl(org.antlr.runtime.Token token)
           
 
Method Summary
 void accept(INRLAstVisitor visitor)
          Accept a visitor to this node.
 String dump(int indent)
          Deprecated. 
 IDeclaration getDeclarationById(String id)
          Return a declaration given its id.
 List<IDeclaration> getDeclarations()
          Return all declarations (rule or fragment) by traversing the second child of the AST (after model) forward
 List<IVariableDeclaration> getGlobalVariableDeclarations()
          Get the list of global variable declarations.
 IModelFileReference[] getModelFileReferences()
          Return the model file references, as they were declared in this rule file.
 ModelCollection getModels()
           
 IOperatorFileReference[] getOperatorFileReferences()
          Return an array of operator file references - can be empty.
 List<IOperator> getOperators()
           
 IRuleDeclaration getRuleById(String id)
          Look up a rule declaration by ID.
 List<IRuleSetDeclaration> getRuleSetDeclarations()
          Return all rule set declarations by traversing the second child of the AST (after model) forward
 
Methods inherited from class net.sourceforge.nrl.parser.ast.impl.Antlr3NRLBaseAst
doIndent, getColumn, getLine, getUserData, initialisePositionFromChild, setColumn, setLine, setUserData
 
Methods inherited from class org.antlr.runtime.tree.CommonTree
dupNode, getCharPositionInLine, getChildIndex, getParent, getText, getToken, getTokenStartIndex, getTokenStopIndex, getType, isNil, setChildIndex, setParent, setTokenStartIndex, setTokenStopIndex, setUnknownTokenBoundaries, toString
 
Methods inherited from class org.antlr.runtime.tree.BaseTree
addChild, addChildren, createChildrenList, deleteChild, freshenParentAndChildIndexes, freshenParentAndChildIndexes, getAncestor, getAncestors, getChild, getChildCount, getChildren, getFirstChildWithType, hasAncestor, replaceChildren, sanityCheckParentAndChildIndexes, sanityCheckParentAndChildIndexes, setChild, toStringTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.nrl.parser.ast.INRLAstNode
getColumn, getLine, getUserData, setUserData
 

Constructor Detail

RuleFileImpl

public RuleFileImpl()

RuleFileImpl

public RuleFileImpl(org.antlr.runtime.Token token)
Method Detail

accept

public void accept(INRLAstVisitor visitor)
Description copied from interface: INRLAstNode
Accept a visitor to this node.

Specified by:
accept in interface INRLAstNode
Overrides:
accept in class Antlr3NRLBaseAst
Parameters:
visitor - the visitor

dump

@Deprecated
public String dump(int indent)
Deprecated. 

Description copied from interface: INRLAstNode
Dump the AST and its children for debugging purposes

Specified by:
dump in interface INRLAstNode
Overrides:
dump in class Antlr3NRLBaseAst
Parameters:
indent - the indentation count, 0 on first call
Returns:
the AST as a string

getModelFileReferences

public IModelFileReference[] getModelFileReferences()
Description copied from interface: IRuleFile
Return the model file references, as they were declared in this rule file.

Specified by:
getModelFileReferences in interface IRuleFile
Returns:
the file references

getOperatorFileReferences

public IOperatorFileReference[] getOperatorFileReferences()
Description copied from interface: IRuleFile
Return an array of operator file references - can be empty.

Specified by:
getOperatorFileReferences in interface IRuleFile
Returns:
the file references

getDeclarations

public List<IDeclaration> getDeclarations()
Return all declarations (rule or fragment) by traversing the second child of the AST (after model) forward

Specified by:
getDeclarations in interface IRuleFile
Returns:
the collection of declarations

getRuleSetDeclarations

public List<IRuleSetDeclaration> getRuleSetDeclarations()
Return all rule set declarations by traversing the second child of the AST (after model) forward

Specified by:
getRuleSetDeclarations in interface IRuleFile
Returns:
the collection of declarations

getDeclarationById

public IDeclaration getDeclarationById(String id)
Return a declaration given its id. The result can be a rule or a property declaration.

Parameters:
id - the id
Returns:
the declaration or null if not found

getRuleById

public IRuleDeclaration getRuleById(String id)
Description copied from interface: IRuleFile
Look up a rule declaration by ID.

Specified by:
getRuleById in interface IRuleFile
Parameters:
id - the rule id
Returns:
the rule or null if not found

getGlobalVariableDeclarations

public List<IVariableDeclaration> getGlobalVariableDeclarations()
Description copied from interface: IRuleFile
Get the list of global variable declarations. This list is a collection of IVariableDeclaration objects with some special properties:

Specified by:
getGlobalVariableDeclarations in interface IRuleFile

getModels

public ModelCollection getModels()

getOperators

public List<IOperator> getOperators()


Copyright © 2006-2013. All Rights Reserved.