Exemplo n.º 1
0
 override public void VisitLongIntLiteral(LongIntLiteral x)
 {
     //string format= "Decimal";
     //switch (x.Format)
     //{
     //    case Literal.LiteralFormat.Binary: format = "Binary"; break;
     //    case Literal.LiteralFormat.Octal: format = "Octal"; break;
     //    case Literal.LiteralFormat.Hexadecimal: format = "Hexadecimal"; break;
     //}
     _serializer.Serialize(typeof(LongIntLiteral).Name, SerializeSpan(x.Span), new NodeObj("Value", x.Value.ToString()) /*, new NodeObj("Format", format)*/);
 }
Exemplo n.º 2
0
        public static Literal /*!*/ Create(Text.Span position, object value, AccessType access)
        {
            Literal result;

            if (value == null)
            {
                result = new NullLiteral(position);
            }
            else if (value.GetType() == typeof(int))
            {
                result = new IntLiteral(position, (int)value);
            }
            else if (value.GetType() == typeof(string))
            {
                result = new StringLiteral(position, (string)value);
            }
            else if (value.GetType() == typeof(bool))
            {
                result = new BoolLiteral(position, (bool)value);
            }
            else if (value.GetType() == typeof(double))
            {
                result = new DoubleLiteral(position, (double)value);
            }
            else if (value.GetType() == typeof(long))
            {
                result = new LongIntLiteral(position, (long)value);
            }
            else if (value.GetType() == typeof(PhpBytes))
            {
                result = new BinaryStringLiteral(position, ((PhpBytes)value).ReadonlyData);
            }
            else
            {
                throw new ArgumentException("value");
            }

            //
            Debug.Assert(result != null);
            result.NodeCompiler <IExpressionCompiler>().Access = access;

            //
            return(result);
        }
Exemplo n.º 3
0
 public override void VisitLongIntLiteral(LongIntLiteral x)
 {
     _composer.ConsumeLiteral(x);
 }
Exemplo n.º 4
0
 virtual public void VisitLongIntLiteral(LongIntLiteral x)
 {
     // nothing
 }
Exemplo n.º 5
0
 override public void VisitLongIntLiteral(LongIntLiteral x)
 {
     _serializer.Serialize(typeof(LongIntLiteral).Name, SerializeSpan(x.Span), new NodeObj("Value", x.Value.ToString()));
 }
Exemplo n.º 6
0
 public override void VisitLongIntLiteral(LongIntLiteral x)
 {
     visitConstantNularyElement(x,
                                (e) => e.LongIntLiteral(x)
                                );
 }
Exemplo n.º 7
0
 /// <inheritdoc />
 public override void VisitLongIntLiteral(LongIntLiteral x)
 {
     RValueResult(x);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Create long integer representation of given literal
 /// </summary>
 /// <param name="x">Literal value</param>
 /// <returns>Created literal value representation</returns>
 public virtual MemoryEntry LongIntLiteral(LongIntLiteral x)
 {
     return(new MemoryEntry(OutSet.CreateLong((long)x.Value)));
 }
Exemplo n.º 9
0
 /// <inheritdoc />
 public override void VisitLongIntLiteral(LongIntLiteral x)
 {
     literal = outSet.CreateLong((long)x.Value);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Visits the long int literal.
 /// </summary>
 /// <param name="x">The x.</param>
 public override void VisitLongIntLiteral(LongIntLiteral x)
 {
     initializationValue = expressionResolver.LongIntLiteral(x);
 }
Exemplo n.º 11
0
            public override void VisitLongIntLiteral(LongIntLiteral x)
            {
                VisitSpecificElementProlog();

                SerializeToken(nameof(x.Value), x.Value.ToString(), x.Span);
            }