Exemple #1
0
 public override Expr Nud()
 {
     bool negativeIntLiteral = Tokenizer.Current.Type == SimpleTokenType.IntLiteral;
     bool negativeFloatLiteral = Tokenizer.Current.Type == SimpleTokenType.FloatLiteral;
     Expr right = ParseExpression(Tokenizer, 1);
     Expr u;
     if (negativeIntLiteral)
     {
         u = new IntExpr(right.Token, -(right as IntExpr).IntValue);
     }
     else if (negativeFloatLiteral)
     {
         u = new FloatExpr(right.Token, -(right as FloatExpr).FloatValue);
     }
     else
     {
         u = new UnaryExpr(this, 0xe6, right);	// NEG
     }
     if (right is VariableExpr || right is MemoryAccessExpr)
     {
         ///			u.IsAssignment = true;
     }
     return u;
 }
Exemple #2
0
 public void Visit(FloatExpr e)
 {
     result = new FloInt(e.FloatValue);
 }