ujf.verimag.bip.parser
Class BipScannSyntaxe

java.lang.Object
  extended by ujf.verimag.bip.parser.BipScannSyntaxe

public class BipScannSyntaxe
extends java.lang.Object

Author:
arobert Module to analyze the AST produce by antlr. The analyze (function scannModuleDefinition) is done in 2 pass: - first pass (function scannDeclarations) to build declaration - second pass (function completeModel)to resolve references (expressions, type reference...)

Constructor Summary
BipScannSyntaxe(BipTreeError msg, BipLibraryReader libReader)
           
 
Method Summary
 void completeModel(Tree tree, NamedElement currentObj, java.lang.String contextName)
           
 Expression generateBinary(Tree tree, BinaryOperator op, java.lang.Object currentObj, java.lang.String contextName)
           
 Expression generateUnary(Tree tree, UnaryOperator op, java.lang.Object currentObj, java.lang.String contextName)
           
 Action scannAction(Tree tree, java.lang.Object currentObj, java.lang.String contextName)
           
 void scannDeclarations(Tree tree, NamedElement currentObj, java.lang.String contextName)
          First step: Generate the objects declarations to be able to generate reference if necessary during the second step.
 Expression scannExpr(Tree tree, java.lang.Object currentObj, java.lang.String contextName)
           
 Expression scannExpr(Tree tree, java.lang.Object currentObj, java.lang.String contextName, boolean isTarget)
           
 java.lang.Object scannExprOrRef(Tree tree, java.lang.Object currentObj, java.lang.String contextName, boolean isTarget)
           
 Module scannModuleDefinition(Tree tree, java.lang.String fileName)
          scan an AST tree to generate the BIP module
 ACExpression scannPortExpr(Tree tree, java.lang.Object currentObj, java.lang.String contextName)
           
 DataReference scannTarget(Tree tree, java.lang.Object currentObj, java.lang.String contextName)
           
 TimeSpecification scannTimedGuard(Tree tree, java.lang.Object currentObj, java.lang.String contextName)
           
 TimeReset scannTimeReset(Tree tree, java.lang.Object currentObj, java.lang.String contextName)
           
 IntegerLiteral scannTimeValue(Tree tree, java.lang.Object currentObj, java.lang.String contextName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BipScannSyntaxe

public BipScannSyntaxe(BipTreeError msg,
                       BipLibraryReader libReader)
Method Detail

scannModuleDefinition

public Module scannModuleDefinition(Tree tree,
                                    java.lang.String fileName)
                             throws java.io.IOException
scan an AST tree to generate the BIP module

Parameters:
tree -
Returns:
Throws:
java.io.IOException

scannDeclarations

public void scannDeclarations(Tree tree,
                              NamedElement currentObj,
                              java.lang.String contextName)
First step: Generate the objects declarations to be able to generate reference if necessary during the second step. When a declaration is generated, this declaration is associated to the tree to be able to complete it in the second step

Parameters:
tree - the AST tree to scan
currentObj - the object containing the current declarations
contextName - the name of the current object

completeModel

public void completeModel(Tree tree,
                          NamedElement currentObj,
                          java.lang.String contextName)

scannTimeReset

public TimeReset scannTimeReset(Tree tree,
                                java.lang.Object currentObj,
                                java.lang.String contextName)

scannPortExpr

public ACExpression scannPortExpr(Tree tree,
                                  java.lang.Object currentObj,
                                  java.lang.String contextName)

scannAction

public Action scannAction(Tree tree,
                          java.lang.Object currentObj,
                          java.lang.String contextName)

scannTimeValue

public IntegerLiteral scannTimeValue(Tree tree,
                                     java.lang.Object currentObj,
                                     java.lang.String contextName)

scannTimedGuard

public TimeSpecification scannTimedGuard(Tree tree,
                                         java.lang.Object currentObj,
                                         java.lang.String contextName)

scannTarget

public DataReference scannTarget(Tree tree,
                                 java.lang.Object currentObj,
                                 java.lang.String contextName)

scannExpr

public Expression scannExpr(Tree tree,
                            java.lang.Object currentObj,
                            java.lang.String contextName)

scannExpr

public Expression scannExpr(Tree tree,
                            java.lang.Object currentObj,
                            java.lang.String contextName,
                            boolean isTarget)

scannExprOrRef

public java.lang.Object scannExprOrRef(Tree tree,
                                       java.lang.Object currentObj,
                                       java.lang.String contextName,
                                       boolean isTarget)

generateUnary

public Expression generateUnary(Tree tree,
                                UnaryOperator op,
                                java.lang.Object currentObj,
                                java.lang.String contextName)

generateBinary

public Expression generateBinary(Tree tree,
                                 BinaryOperator op,
                                 java.lang.Object currentObj,
                                 java.lang.String contextName)