Beispiel #1
0
        internal override Expression Resolve(Parser parser)
        {
            this.Condition  = this.Condition.Resolve(parser);
            this.TrueValue  = this.TrueValue.Resolve(parser);
            this.FalseValue = this.FalseValue.Resolve(parser);

            BooleanConstant bc = this.Condition as BooleanConstant;

            if (bc != null)
            {
                return(bc.Value ? this.TrueValue : this.FalseValue);
            }

            return(this);
        }
Beispiel #2
0
        internal override IList <Executable> Resolve(Parser parser)
        {
            this.Condition = this.Condition.Resolve(parser);

            this.TrueCode  = Resolve(parser, this.TrueCode).ToArray();
            this.FalseCode = Resolve(parser, this.FalseCode).ToArray();

            BooleanConstant bc = this.Condition as BooleanConstant;

            if (bc != null)
            {
                return(bc.Value ? this.TrueCode : this.FalseCode);
            }

            return(Listify(this));
        }
Beispiel #3
0
		protected override void TranslateBooleanConstant(List<string> output, BooleanConstant booleanConstant)
		{
			output.Add(booleanConstant.Value ? "TRUE" : "FALSE");
		}
Beispiel #4
0
		private void CompileBooleanConstant(Parser parser, ByteBuffer buffer, BooleanConstant boolConstant, bool outputUsed)
		{
			if (!outputUsed) throw new ParserException(boolConstant.FirstToken, "This expression does nothing.");
			buffer.Add(boolConstant.FirstToken, OpCode.LITERAL, parser.GetBoolConstant(boolConstant.Value));
		}
		protected override void TranslateBooleanConstant(List<string> output, BooleanConstant booleanConstant)
		{
			output.Add(booleanConstant.Value ? "true" : "false");
		}
Beispiel #6
0
		protected abstract void TranslateBooleanConstant(List<string> output, BooleanConstant booleanConstant);