コード例 #1
0
 public override void ExitInclusiveOrExpression(CParser.InclusiveOrExpressionContext context)
 {
     if (context.inclusiveOrExpression() != null)
     {
         // inclusiveOrExpression '|' exclusiveOrExpression
         SafeCall(context, CExpression.BitwiseOrOperator);
     }
 }
コード例 #2
0
        protected ObjectDef EmitInclusiveOrExpression(CParser.InclusiveOrExpressionContext inclusiveOrExpression)
        {
            ObjectDef returnObjectDef = null;

            if (inclusiveOrExpression.exclusiveOrExpression() != null)
            {
                returnObjectDef = EmitExclusiveOrExpression(inclusiveOrExpression.exclusiveOrExpression());
            }

            if (inclusiveOrExpression.exclusiveOrExpression() != null &&
                inclusiveOrExpression.inclusiveOrExpression() != null)
            {
                var orObj = EmitInclusiveOrExpression(inclusiveOrExpression.inclusiveOrExpression());

                orObj.Load();
                returnObjectDef.Load();
                _generatorIL.Emit(OpCodes.Or);

                returnObjectDef = LocalObjectDef.AllocateLocal(typeof(int));
            }

            return(returnObjectDef);
        }