org.makumba.providers.query.mql
Class MqlNode

java.lang.Object
  extended by antlr.BaseAST
      extended by antlr.CommonAST
          extended by org.makumba.providers.query.mql.MqlNode
All Implemented Interfaces:
antlr.collections.AST, Serializable
Direct Known Subclasses:
MqlBinaryOperator, MqlDotNode, MqlIdentNode

public class MqlNode
extends antlr.CommonAST

The root of Mql analysis tree nodes. It performs analysis as the tree is built. It should know how to determine its Makumba type, if it is not a parameter.

Version:
$Id: MqlNode.java,v 1.1 Aug 5, 2008 5:38:16 PM cristi Exp $
Author:
Cristian Bogdan
See Also:
Serialized Form

Field Summary
protected  ArrayList<String> checkAsIds
           
(package private)  MqlSqlWalker walker
           
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
MqlNode()
           
 
Method Summary
protected  boolean checkAndRewriteOperand(MqlNode left, MqlNode right)
          Symmetrically check both sides for operands that need to be rewritten
protected  void checkForOperandType(MqlNode ast)
           
(package private)  void checkOperandTypes(MqlNode left, MqlNode right)
           
protected  boolean checkParam(MqlNode left, MqlNode right)
           
protected  FieldDefinition findMakType(MqlNode child)
           
 MqlNode getFather()
           
 FieldDefinition getMakType()
           
 String getOriginalText()
           
protected  MqlSqlWalker getWalker()
           
 void initialize(antlr.collections.AST t)
           
(package private)  boolean isFunctionCall()
          whether this is a custom MDD function call
(package private)  boolean isParam()
           
(package private)  String knownType()
           
protected  FieldDefinition makeBooleanFieldDefinition()
           
protected  void oneMoreChild(MqlNode child)
           
 void setFather(MqlNode node)
          we analyze the tree as it is built
 void setFirstChild(antlr.collections.AST a)
          we analyze the tree as it is built, we call oneMoreChild() to see whether we are ready for analysis
 void setMakType(FieldDefinition fd)
           
 void setNextSibling(antlr.collections.AST a)
          we analyze the tree as it is built, we call oneMoreChild() of the father to see whether it is ready for analysis
 void setText(String text)
           
 void setTextList(NameResolver.TextList tl)
           
 void setType(int type)
           
protected  void setWalker(MqlSqlWalker walker)
           
 String toString()
           
 void writeTo(NameResolver.TextList t)
           
 
Methods inherited from class antlr.CommonAST
getText, getType, initialize, initialize
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getColumn, getFirstChild, getLine, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

walker

MqlSqlWalker walker

checkAsIds

protected ArrayList<String> checkAsIds
Constructor Detail

MqlNode

public MqlNode()
Method Detail

getWalker

protected MqlSqlWalker getWalker()

setWalker

protected void setWalker(MqlSqlWalker walker)

setFather

public void setFather(MqlNode node)
we analyze the tree as it is built


getFather

public MqlNode getFather()

setFirstChild

public void setFirstChild(antlr.collections.AST a)
we analyze the tree as it is built, we call oneMoreChild() to see whether we are ready for analysis

Specified by:
setFirstChild in interface antlr.collections.AST
Overrides:
setFirstChild in class antlr.BaseAST

setNextSibling

public void setNextSibling(antlr.collections.AST a)
we analyze the tree as it is built, we call oneMoreChild() of the father to see whether it is ready for analysis

Specified by:
setNextSibling in interface antlr.collections.AST
Overrides:
setNextSibling in class antlr.BaseAST

oneMoreChild

protected void oneMoreChild(MqlNode child)

findMakType

protected FieldDefinition findMakType(MqlNode child)

setMakType

public void setMakType(FieldDefinition fd)

getMakType

public FieldDefinition getMakType()

setText

public void setText(String text)
Specified by:
setText in interface antlr.collections.AST
Overrides:
setText in class antlr.CommonAST

setType

public void setType(int type)
Specified by:
setType in interface antlr.collections.AST
Overrides:
setType in class antlr.CommonAST

initialize

public void initialize(antlr.collections.AST t)
Specified by:
initialize in interface antlr.collections.AST
Overrides:
initialize in class antlr.CommonAST

knownType

String knownType()

checkForOperandType

protected void checkForOperandType(MqlNode ast)

isParam

boolean isParam()

isFunctionCall

boolean isFunctionCall()
whether this is a custom MDD function call


checkOperandTypes

void checkOperandTypes(MqlNode left,
                       MqlNode right)
                 throws antlr.SemanticException
Throws:
antlr.SemanticException

getOriginalText

public String getOriginalText()

writeTo

public void writeTo(NameResolver.TextList t)

toString

public String toString()
Specified by:
toString in interface antlr.collections.AST
Overrides:
toString in class antlr.BaseAST

setTextList

public void setTextList(NameResolver.TextList tl)

checkAndRewriteOperand

protected boolean checkAndRewriteOperand(MqlNode left,
                                         MqlNode right)
                                  throws antlr.SemanticException
Symmetrically check both sides for operands that need to be rewritten

Throws:
antlr.SemanticException

checkParam

protected boolean checkParam(MqlNode left,
                             MqlNode right)

makeBooleanFieldDefinition

protected FieldDefinition makeBooleanFieldDefinition()