Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Package Attributes | Static Package Attributes
rene.zirkel.expression.FindObjectExpression Class Reference
Inheritance diagram for rene.zirkel.expression.FindObjectExpression:
Inheritance graph
[legend]
Collaboration diagram for rene.zirkel.expression.FindObjectExpression:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FindObjectExpression (String name, Construction c)
ConstructionObject getObject ()
double getValue () throws ConstructionException
void translate ()
String toString ()
void laterTranslate (Construction from)
 Used to translate expressions with in macros.
boolean isNumber ()
void reset ()
boolean isLogical ()

Static Public Member Functions

static BasicExpression scan (ExpressionText t, boolean quotes) throws ConstructionException
static BasicExpression scan (ExpressionText t) throws ConstructionException
static BasicExpression scan (ExpressionText t, int sign) throws ConstructionException
static String quote (String name)
static BasicExpression scanBracket (ExpressionText t) throws ConstructionException

Package Attributes

String Name
String Var = null
Construction C
ConstructionObject O = null
BasicExpression E

Static Package Attributes

static final int MINUS = -1
static final int PLUS = 1

Detailed Description

Definition at line 217 of file Expression.java.


Constructor & Destructor Documentation

Definition at line 224 of file Expression.java.

       {      super(null);
              Name=name;
              C=c;
       }

Here is the caller graph for this function:


Member Function Documentation

Reimplemented from rene.zirkel.expression.ObjectExpression.

Definition at line 230 of file Expression.java.

       {      if (C==null) return null;
              if (O!=null && O.getConstruction()==C && O.isInConstruction()
                            && O.getName().equals(Name)) return O;
              return O=C.find(Name);
       }

Here is the call graph for this function:

Reimplemented from rene.zirkel.expression.ObjectExpression.

Definition at line 237 of file Expression.java.

       {      if (C==null)
                     throw new InvalidException("");
              if (O!=null && O.getConstruction()==C && O.isInConstruction()
                            && O.getName().equals(Name)) return O.getValue();
              O=C.find(Name);
              if (O==null)
                     throw new InvalidException("");
              return O.getValue();
       }

Here is the call graph for this function:

Reimplemented in rene.zirkel.expression.OrExpression, rene.zirkel.expression.AndExpression, rene.zirkel.expression.NotExpression, and rene.zirkel.expression.CompareExpression.

Definition at line 143 of file Expression.java.

       {      return false;
       }

Here is the caller graph for this function:

Reimplemented in rene.zirkel.expression.MinusExpression, rene.zirkel.expression.ElementaryExpression, rene.zirkel.expression.BracketExpression, and rene.zirkel.expression.DoubleExpression.

Definition at line 135 of file Expression.java.

       {      return false;
       }

Here is the caller graph for this function:

Used to translate expressions with in macros.

Implements rene.zirkel.expression.Translator.

Definition at line 294 of file Expression.java.

       {      if (C==null) return;
              ConstructionObject o=from.find(Name);
              if (o==null || o.getTranslation()==null) 
              {      from.addError(ConstructionObject.text1(
                            Zirkel.name("warning.macrodefinition"),Name));
                     return;
              }
              Name=o.getTranslation().getName();
              O=null;
       }

Here is the call graph for this function:

static String rene.zirkel.expression.ObjectExpression.quote ( String  name) [inline, static, inherited]

Definition at line 424 of file Expression.java.

       {      boolean quotes=false;
              for (int i=0; i<name.length(); i++)
              {      if (!Character.isLetterOrDigit(name.charAt(i)))
                     {      quotes=true;
                            break;
                     }
              }
              if (quotes) return "\""+name+"\"";
              else return name;
       }

Here is the caller graph for this function:

void rene.zirkel.expression.BasicExpression.reset ( ) [inline, inherited]
static BasicExpression rene.zirkel.expression.BasicExpression.scan ( ExpressionText  t,
int  sign 
) throws ConstructionException [inline, static, inherited]

Definition at line 107 of file Expression.java.

       {      if (sign==MINUS)
              {      if (t.next()=='(') return new MinusExpression(scanBracket(t));
                     return new MinusExpression(ElementaryExpression.scan(t));
              }
              if (t.next()=='(') return scanBracket(t);
              return ElementaryExpression.scan(t);
       }

Here is the call graph for this function:

Reimplemented from rene.zirkel.expression.ObjectExpression.

Definition at line 248 of file Expression.java.

       {      if (!quotes && t.next()=='\"')
              {      t.advance();
                     BasicExpression E=scan(t,true);
                     if (t.next()!='\"')
                            throw new ConstructionException(Zirkel.name("exception.quotes"));
                     t.advance();
                     return E;
              }
              StringBuffer b=new StringBuffer();
              while (true)
              {      char c=t.next(quotes);
                     if (!(Character.isLetterOrDigit(c) 
                     || c=='\\' 
                     || c=='\''
                     || (quotes && c!='\"' && c!=0)
                     || (quotes && c==' '))) 
                            break;
                     b.append(c);
                     t.advance(quotes);
              }
              if (!quotes && t.next()=='(')
                     return FunctionExpression.scan(t,b.toString());
              String s=b.toString();
              return new FindObjectExpression(s,t.getConstruction());
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from rene.zirkel.expression.ObjectExpression.

Definition at line 276 of file Expression.java.

       {      return scan(t,false);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 118 of file Expression.java.

       {      t.advance();
              BasicExpression E=TopExpression.scan(t);
              if (t.next()==')') t.advance();
              else
                     throw new ConstructionException(Zirkel.name("exception.bracket"));
              return E;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from rene.zirkel.expression.ObjectExpression.

Definition at line 286 of file Expression.java.

       {      if (Var!=null) return Var;
              return "@"+ObjectExpression.quote(Name);
       }

Here is the call graph for this function:

Reimplemented from rene.zirkel.expression.ObjectExpression.

Definition at line 281 of file Expression.java.

       {      C=C.getTranslation();
              C.addTranslator(this);
       }

Here is the call graph for this function:


Member Data Documentation

Definition at line 221 of file Expression.java.

final int rene.zirkel.expression.BasicExpression.MINUS = -1 [static, package, inherited]

Definition at line 91 of file Expression.java.

Definition at line 219 of file Expression.java.

Reimplemented from rene.zirkel.expression.ObjectExpression.

Definition at line 222 of file Expression.java.

final int rene.zirkel.expression.BasicExpression.PLUS = 1 [static, package, inherited]

Definition at line 91 of file Expression.java.

Reimplemented from rene.zirkel.expression.ObjectExpression.

Definition at line 220 of file Expression.java.


The documentation for this class was generated from the following file: