Esempio n. 1
0
        public void CompileConstantDecl(ConstantDecl cstDecl)
        {
            XmlElement tmpElement = document.CreateElement("ConstantDecl");

            ProcessPropertyInitializers(tmpElement, cstDecl.Initializers);
            currentElement.AppendChild(tmpElement);
        }
Esempio n. 2
0
            public override void VisitConstantDecl(ConstantDecl x)
            {
                VisitSpecificElementProlog();

                SerializeToken(nameof(x.Name), x.Name.ToString(), x.Name.Span);

                base.VisitConstantDecl(x);
            }
Esempio n. 3
0
        public override void ConstantDeclaration(ConstantDecl x, MemoryEntry constantValue)
        {
            var constantName = ".constant_" + x.Name;
            var constantVar  = new VariableIdentifier(constantName);

            OutSet.FetchFromGlobal(constantVar.DirectName);

            OutSet.GetVariable(constantVar).WriteMemory(OutSnapshot, constantValue);
        }
Esempio n. 4
0
        public override void VisitConstantDecl(ConstantDecl x)
        {
            ConsumeToken(Tokens.T_STRING, x.Name.Name.Value);

            if (x.Initializer != null)  // always true
            {
                ConsumeToken(Tokens.T_EQ, "=");
                VisitElement(x.Initializer);
            }
        }
Esempio n. 5
0
        public void CompileConstantDecl(ConstantDecl cstDecl)
        {
            textWriter.Write("const ");

            for (int i = 0; i < cstDecl.Initializers.Length; ++i)
            {
                if (i > 0)
                {
                    textWriter.Write(", ");
                }
                DumpPropertyInitializer(cstDecl.Initializers[i]);
            }

            textWriter.WriteLine(";");
        }
Esempio n. 6
0
 /// <summary>
 /// Visit constant initializer expression.
 /// </summary>
 /// <param name="x"></param>
 virtual public void VisitConstantDecl(ConstantDecl x)
 {
     VisitElement(x.Initializer);
 }
Esempio n. 7
0
 internal ConstantDeclPoint(ConstantDecl declaration, ValuePoint initializer)
 {
     Declaration = declaration;
     Initializer = initializer;
 }
Esempio n. 8
0
 /// <summary>
 /// Is called on <c>const x = 5</c> declarations
 /// </summary>
 /// <param name="x">Constant declaration</param>
 /// <param name="constantValue">Value assigned into constant</param>
 public abstract void ConstantDeclaration(ConstantDecl x, MemoryEntry constantValue);
Esempio n. 9
0
 public static void Analyze(this ConstantDecl /*!*/ node, Analyzer /*!*/ analyzer)
 {
     node.NodeCompiler <IConstantDeclCompiler>().Analyze(node, analyzer);
 }
Esempio n. 10
0
 void IConstantDeclCompiler.Analyze(ConstantDecl node, Analyzer analyzer)
 {
     Analyze((T)node, analyzer);
 }