public override String Print(int depth) { var str = LValue.Print(depth) + " = "; if (Qualifier != null) { str += Qualifier.Print(depth); } else { str += (Expr == null ? Statement.Print(depth) : Expr.Print(depth)); } return(str); }
public override void VisitQualifier(Qualifier n) { n.Expression.Visit(this); MethodInfo info = null; switch (n.Type.ToLower()) { case "date": info = typeof (DateTime).GetMethod("Parse", BindingFlags.Public | BindingFlags.Static, null, new[] { _lastWalkedType }, null); break; case "real": info = typeof(Double).GetMethod("Parse", BindingFlags.Public | BindingFlags.Static, null, new[] { _lastWalkedType }, null); break; case "integer": info = typeof(Int32).GetMethod("Parse", BindingFlags.Public | BindingFlags.Static, null, new[] { _lastWalkedType }, null); break; case "boolean": info = typeof(Boolean).GetMethod("Parse", BindingFlags.Public | BindingFlags.Static, null, new[] { _lastWalkedType }, null); break; default: throw new Exception("Invalid type qualifier: (" + n.Type + ")"); } _gen.Emit(OpCodes.Call, info); }
public override void VisitQualifier(Qualifier n) { n.Expression.Visit(this); switch(n.Type.ToLower()) { case "date": _lastSeenType = n.InternalType = new TypeDate(); break; case "real": _lastSeenType = n.InternalType = new TypeReal(); break; case "integer": _lastSeenType = n.InternalType = new TypeInteger(); break; case "string": _lastSeenType = n.InternalType = new TypeString(); break; case "boolean": _lastSeenType = n.InternalType = new TypeBoolean(); break; default: throw new Exception("Unknown type qualifier: (" + n.Type + ")"); } }
public Assign(LValue lval, Qualifier qual) { lval.IsLeftHandSide = true; LValue = lval; Qualifier = qual; }