Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Package Attributes | Static Package Attributes
rene.zirkel.expression.ObjectExpression Class Reference

object = name object = "name" More...

Inheritance diagram for rene.zirkel.expression.ObjectExpression:
Inheritance graph
[legend]
Collaboration diagram for rene.zirkel.expression.ObjectExpression:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ObjectExpression (ConstructionObject o)
double getValue () throws ConstructionException
ConstructionObject getObject ()
void translate ()
String toString ()
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 String quote (String name)
static BasicExpression scan (ExpressionText t, int sign) throws ConstructionException
static BasicExpression scanBracket (ExpressionText t) throws ConstructionException

Package Attributes

ConstructionObject O
String Var = null
BasicExpression E

Static Package Attributes

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

Detailed Description

object = name object = "name"

Definition at line 312 of file Expression.java.


Constructor & Destructor Documentation

Definition at line 315 of file Expression.java.

       {      O=o;
       }

Here is the caller graph for this function:


Member Function Documentation

Reimplemented in rene.zirkel.expression.FindObjectExpression.

Definition at line 329 of file Expression.java.

       {      return O;
       }

Reimplemented from rene.zirkel.expression.BasicExpression.

Reimplemented in rene.zirkel.expression.FindObjectExpression.

Definition at line 319 of file Expression.java.

       {      if (!O.valid())
                     throw new InvalidException("");
              if (Var!=null && 
                            (O instanceof FunctionObject)) return ((FunctionObject)O).getValue(Var);
              if (Var!=null && 
                            (O instanceof UserFunctionObject)) return ((UserFunctionObject)O).getValue(Var);
              return O.getValue();
       }

Here is the call graph for this function:

Here is the caller 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:

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

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 in rene.zirkel.expression.FindObjectExpression.

Definition at line 332 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();
              if (s.equals("pi")) return new ConstantExpression("pi",Math.PI);
              if (s.equals("valid")) return new ValidExpression(true);
              if (s.equals("invalid")) return new ValidExpression(false);
              if (s.equals("this"))
              {      t.getDepList().add(t.getObject());
                     return new ObjectExpression(t.getObject());
              }
              if (s.equals("windoww")) 
                     return new ConstructionExpression(t.getConstruction(),
                                   ConstructionExpression.WIDTH);
              if (s.equals("windowh")) 
                     return new ConstructionExpression(t.getConstruction(),
                                   ConstructionExpression.HEIGHT);
              if (s.equals("windowcx")) 
                     return new ConstructionExpression(t.getConstruction(),
                                   ConstructionExpression.CENTERX);
              if (s.equals("windowcy")) 
                     return new ConstructionExpression(t.getConstruction(),
                                   ConstructionExpression.CENTERY);
              if (s.equals("pixel")) 
                     return new ConstructionExpression(t.getConstruction(),
                                   ConstructionExpression.PIXEL);
              if (t.isVar(s))
              {      ObjectExpression oe=new ObjectExpression(t.getObject());
                     oe.Var=s;
                     return oe;
              }
              ConstructionObject o=
                     t.getConstruction().findInclusive(s,t.getObject());
              if (o==null)
              {      o=t.getConstruction().find(s);
                     if (o==null)
                     {      if (t.getConstruction().loading())
                                   return new FindObjectExpression(s,t.getConstruction());
                            else
                                   throw new ConstructionException(Zirkel.name("exception.notfound")
                                                 +" ("+s+")");
                     }
                     //System.out.println("---");
                     //System.out.println(o.getName()+" "+t.getObject().getName());
                     //System.out.println(t.getConstruction().dependsOn(o,t.getObject()));
                     if (t.getConstruction().dependsOn(o,t.getObject()))
                     {      if (t.nocircles())
                                   throw new ConstructionException(
                                                 ConstructionObject.text1(Zirkel.name("exception.depends"),s));
                            return new FindObjectExpression(s,t.getConstruction());
                     }
                     t.getConstruction().needsOrdering();
              }
              t.getDepList().add(o);
              return new ObjectExpression(o);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from rene.zirkel.expression.BasicExpression.

Reimplemented in rene.zirkel.expression.FindObjectExpression.

Definition at line 409 of file Expression.java.

       {      if (t.next()=='@')
              {      t.advance();
                     return FindObjectExpression.scan(t);
              }
              return scan(t,false);
       }

Here is the call 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 in rene.zirkel.expression.FindObjectExpression.

Definition at line 420 of file Expression.java.

       {      if (Var!=null) return Var;
              return quote(O.getName());
       }

Here is the call graph for this function:

Reimplemented from rene.zirkel.expression.BasicExpression.

Reimplemented in rene.zirkel.expression.FindObjectExpression.

Definition at line 417 of file Expression.java.

       {      O=O.getTranslation();
       }

Here is the call graph for this function:


Member Data Documentation

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

Definition at line 91 of file Expression.java.

Reimplemented in rene.zirkel.expression.FindObjectExpression.

Definition at line 313 of file Expression.java.

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

Definition at line 91 of file Expression.java.

Reimplemented in rene.zirkel.expression.FindObjectExpression.

Definition at line 314 of file Expression.java.


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