예제 #1
0
        public override Node ExitHexliteral(PerCederberg.Grammatica.Runtime.Token node)
        {
            var element = IntegralLiteralElement.Create(node.Image, true, inUnaryNegate, context.BuilderOptions);

            node.AddValue(element);
            return(node);
        }
예제 #2
0
        public override Node ExitCharLiteral(PerCederberg.Grammatica.Runtime.Token node)
        {
            var s = DoEscapes(node.Image);

            node.AddValue(new CharLiteralElement(s[0]));
            return(node);
        }
예제 #3
0
        public override Node ExitDatetime(PerCederberg.Grammatica.Runtime.Token node)
        {
            var image   = node.Image.Substring(1, node.Image.Length - 2);
            var element = new DateTimeLiteralElement(image, context);

            node.AddValue(element);
            return(node);
        }
예제 #4
0
        public override Node ExitTimeSpan(PerCederberg.Grammatica.Runtime.Token node)
        {
            var image   = node.Image.Substring(2, node.Image.Length - 3);
            var element = new TimeSpanLiteralElement(image);

            node.AddValue(element);
            return(node);
        }
예제 #5
0
        public override Node ExitStringLiteral(PerCederberg.Grammatica.Runtime.Token node)
        {
            var s       = DoEscapes(node.Image);
            var element = new StringLiteralElement(s);

            node.AddValue(element);
            return(node);
        }
예제 #6
0
 public override Node ExitOr(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue(AndOrOperation.Or);
     return(node);
 }
예제 #7
0
 public override Node ExitGte(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue(LogicalCompareOperation.GreaterThanOrEqual);
     return(node);
 }
예제 #8
0
 public override Node ExitLt(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue(LogicalCompareOperation.LessThan);
     return(node);
 }
예제 #9
0
 public override Node ExitPower(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue(BinaryArithmeticOperation.Power);
     return(node);
 }
예제 #10
0
 public override Node ExitArrayBraces(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue("[]");
     return(node);
 }
예제 #11
0
 public override Node ExitEverything(Token node)
 {
     node.AddValue(node.Image.ToString());
     return base.ExitEverything(node);
 }
예제 #12
0
 public override Node ExitUserName(Token node)
 {
     node.AddValue(node.GetImage().Substring(9).Trim());
     return node;
 }
예제 #13
0
 public override Node ExitRightShift(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue(ShiftOperation.RightShift);
     return(node);
 }
예제 #14
0
 public override Node ExitXor(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue("Xor");
     return(node);
 }
예제 #15
0
 public override Node ExitNumber(Token node)
 {
     node.AddValue(Int32.Parse(node.Image));
     return base.ExitNumber(node);
 }
예제 #16
0
 public override Node ExitFalse(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue(new BooleanLiteralElement(false));
     return(node);
 }
예제 #17
0
 public override Node ExitWhitespace(Token node)
 {
     node.AddValue(node.Image.ToString());
     return base.ExitWhitespace(node);
 }
예제 #18
0
 public override Node ExitNot(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue(string.Empty);
     return(node);
 }
예제 #19
0
 public override Node ExitIdentifier(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue(node.Image);
     return(node);
 }
예제 #20
0
 private static Node EchoImage(Token node)
 {
     node.AddValue(node.Image);
     return node;
 }
예제 #21
0
 public override Node ExitNullLiteral(PerCederberg.Grammatica.Runtime.Token node)
 {
     node.AddValue(new NullLiteralElement());
     return(node);
 }
예제 #22
0
 public override Node ExitQuotedString(Token node)
 {
     string quotedString = node.GetImage();
     // Remove first and last char which are both a quote.
     string content = quotedString.Substring(1, quotedString.Length - 2);
     node.AddValue(content);
     return node;
 }
예제 #23
0
 public override Node ExitCharacter(Token node)
 {
     node.AddValue(node.Image.ToString());
     return base.ExitCharacter(node);
 }