Exemplo n.º 1
0
        public override object VisitBoolExpr(BoolExprContext context)
        {
            var r = (new Result());

            if (context.t.Type == TrueLiteral)
            {
                r.data = TargetTypeBool;
                r.text = T;
            }
            else if (context.t.Type == FalseLiteral)
            {
                r.data = TargetTypeBool;
                r.text = F;
            }
            return(r);
        }
        public IHolderCil Visit(BoolExprContext parserRule, IFunctionCil cilTree, IContextCil contextCil)
        {
            var value = CreateABasicType(cilTree, CilAst.Bool);

            switch ([email protected])
            {
            case "true":
                SetValue(value, new HolderCil("1"), cilTree, CilAst.Bool);
                break;

            case "false":
                SetValue(value, new HolderCil("0"), cilTree, CilAst.Bool);
                break;

            default:
                break;
            }
            return(value);
        }
 public void Visit(BoolExprContext parserRule, IObjectContext <IVar, IVar> context)
 {
     parserRule.computedType = globalContext.Bool;
 }