Exemple #1
0
	void Associative_BitUnaryExpression(out ProtoCore.AST.AssociativeAST.AssociativeNode node) {
		node = null; 
		UnaryOperator op; 
		ProtoCore.AST.AssociativeAST.AssociativeNode exprNode; 
		Associative_unaryop(out op);
		Associative_Factor(out exprNode);
		if (!core.Options.AssocOperatorAsMethod)
		{
		   // expression is converted to function call to support replication
		   ProtoCore.AST.AssociativeAST.UnaryExpressionNode unary = new ProtoCore.AST.AssociativeAST.UnaryExpressionNode(); 
		   unary.Operator = op;
		   unary.Expression = exprNode;
		   node = unary;
		}
		else
		{
		   node = GenerateUnaryOperatorMethodCallNode(op, exprNode);
		}
		
		if (core.Options.AssocOperatorAsMethod && (op == UnaryOperator.Increment || op == UnaryOperator.Decrement))
		{
		   node = new ProtoCore.AST.AssociativeAST.BinaryExpressionNode(){ LeftNode = exprNode, Optr = Operator.assign, RightNode = node }; 
		}
		
	}
Exemple #2
0
	void Associative_NegExpression(out ProtoCore.AST.AssociativeAST.AssociativeNode node) {
		node = null; 
		UnaryOperator op; 
		ProtoCore.AST.AssociativeAST.AssociativeNode exprNode = null; 
		Associative_negop(out op);
		Associative_IdentifierList(out exprNode);
		if (!core.Options.AssocOperatorAsMethod)
		{
		   //expression is converted to function call to support replication
		   ProtoCore.AST.AssociativeAST.UnaryExpressionNode unary = new ProtoCore.AST.AssociativeAST.UnaryExpressionNode(); 
		   unary.Operator = op;
		   unary.Expression = exprNode;
		   node = unary;
		}
		else
		{
		   node = GenerateUnaryOperatorMethodCallNode(op, exprNode);
		}
		
	}