예제 #1
0
 public void Visit(UnaryExpressionNode expression)
 {
     expression.Child.Accept(this);
     EmitComment("Unary operator " + expression.Operator);
     if (expression.Operator == Operator.Subtract)
     {
         Emit("neg");
     }
     else
     {
         throw new Exception("Unsupported unary operator: " + expression.Operator);
     }
 }
예제 #2
0
 /*statement-expression-factorized:
  | assignment-operator expresion statement-expresion-p
  | statement-expresion-p */
 private ExpressionNode statement_expression_factorized(UnaryExpressionNode leftValue)
 {
     printIfDebug("statement_expression_factorized");
     if (pass(assignmentOperatorOptions))
     {
         var assignmentOperator = token;
         consumeToken();
         var exp = expression();
         // return statement_expression_p(new AssignExpressionNode(leftValue,assignmentOperator.type,exp));
         return(new AssignExpressionNode(leftValue, assignmentOperator.type, exp, assignmentOperator));
     }
     else
     {
         // return statement_expression_p(leftValue);
         return(leftValue);
     }
 }
 public void Visit(UnaryExpressionNode expression)
 {
     expression.Child.Accept(this);
     EmitComment("Unary operator " + expression.Operator);
     if (expression.Operator == Operator.Subtract)
         Emit("ineg");
     else
         throw new Exception("Unsupported unary operator: " + expression.Operator);
 }
예제 #4
0
 public void Visit(UnaryExpressionNode expression)
 {
 }
 public void Visit(UnaryExpressionNode expression)
 {
 }