Exemplo n.º 1
0
 private CodeExpression Visit(Ast.VariableRef varRef)
 {
     if (varRef.VariableInfo is Parameter)
     {
         return(new CodeArgumentReferenceExpression(varRef.VariableInfo.Name));
     }
     else if (varRef.VariableInfo is Field)
     {
         return(new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), varRef.VariableInfo.Name));
     }
     else
     {
         return(new CodeVariableReferenceExpression(varRef.VariableInfo.Name));
     }
 }
Exemplo n.º 2
0
 public Assign(LexemeValue varName, Expression value)
 {
     Variable = new VariableRef(varName);
     Value    = value;
 }
Exemplo n.º 3
0
 public ArrayAssign(LexemeValue arrayName, Expression index, Expression value)
 {
     Array = new VariableRef(arrayName);
     Index = index;
     Value = value;
 }
Exemplo n.º 4
0
 public Variable(LexemeValue name)
 {
     VariableRef = new VariableRef(name);
 }