org.apache.jdo.impl.jdoql.jdoqlc
Class VariableChecker

java.lang.Object
  extended by org.apache.jdo.impl.jdoql.jdoqlc.VariableChecker

public class VariableChecker
extends java.lang.Object

Checks variable declarations/application.

Version:
0.1
Author:
Michael Bouschen

Field Summary
protected static org.apache.jdo.util.I18NHelper msg
          I18N support
protected  java.util.Map varInfos
          Map of variable infos
 
Constructor Summary
VariableChecker()
          Create an empty variable table
VariableChecker(VariableChecker other)
          Create a variable table initialized with the entries of the other variable table.
 
Method Summary
 void add(java.lang.String name)
          Creates a new entry in the variable table with the specified name as key and an empty value.
protected  void attachConstraintToUsedAST(org.apache.jdo.impl.jdoql.jdoqlc.VariableChecker.VarInfo info)
           
protected  void checkConstraint(java.lang.String variable, org.apache.jdo.impl.jdoql.jdoqlc.VariableChecker.VarInfo info)
           
 void checkConstraints()
           
 void markConstraint(JDOQLAST variable, JDOQLAST expr)
          Mark the specified variable as constaint with the specified expr.
 void markUsed(JDOQLAST variable, java.lang.String dependendVar)
          Mark the specified variable as used.
 void merge(VariableChecker other)
          Merges the specified variable table (other) into this variable table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

msg

protected static final org.apache.jdo.util.I18NHelper msg
I18N support


varInfos

protected java.util.Map varInfos
Map of variable infos

Constructor Detail

VariableChecker

public VariableChecker()
Create an empty variable table


VariableChecker

public VariableChecker(VariableChecker other)
Create a variable table initialized with the entries of the other variable table. The constructor creates copies of the values stored in the map (instances of class VarInfo).

Method Detail

add

public void add(java.lang.String name)
Creates a new entry in the variable table with the specified name as key and an empty value.


markUsed

public void markUsed(JDOQLAST variable,
                     java.lang.String dependendVar)
Mark the specified variable as used. The method sets the info field of the VarInfo object to true.


markConstraint

public void markConstraint(JDOQLAST variable,
                           JDOQLAST expr)
Mark the specified variable as constaint with the specified expr. The method sets the constraint field of the VarInfo object to true.


merge

public void merge(VariableChecker other)
Merges the specified variable table (other) into this variable table.


checkConstraints

public void checkConstraints()

checkConstraint

protected void checkConstraint(java.lang.String variable,
                               org.apache.jdo.impl.jdoql.jdoqlc.VariableChecker.VarInfo info)

attachConstraintToUsedAST

protected void attachConstraintToUsedAST(org.apache.jdo.impl.jdoql.jdoqlc.VariableChecker.VarInfo info)


Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.