/// <summary>
        ///     Generates the code for an ArgumentDeclarationList node.
        /// </summary>
        /// <param name="adl">The ArgumentDeclarationList node.</param>
        /// <returns>String containing C# code for ArgumentDeclarationList adl.</returns>
        private string GenerateArgumentDeclarationList(ArgumentDeclarationList adl)
        {
            StringBuilder retVal = new StringBuilder();
            int comma = adl.kids.Count - 1; // tells us whether to print a comma

            foreach (Declaration d in adl.kids)
            {
                retVal.Append(GenerateDeclaration(d));
                //                retstr += Generate(String.Format("{0} {1}", d.Datatype, CheckName(d.Id)), d);
                if (0 < comma--)
                    retVal.Append(Generate(", "));
            }

            return retVal.ToString();
        }
示例#2
0
 public StateEvent(Parser yyp, string name, ArgumentDeclarationList dal, CompoundStatement cs) : base((yyp))
 {
     m_name = name;
     if (0 < dal.kids.Count) kids.Add(dal);
     kids.Add(cs);
 }
示例#3
0
 public ArgumentDeclarationList(Parser yyp, ArgumentDeclarationList adl, Declaration d) : base((yyp))
 {
     while (0 < adl.kids.Count) kids.Add(adl.kids.Pop());
     kids.Add(d);
 }
示例#4
0
 public GlobalFunctionDefinition(Parser yyp, string returnType, string name, ArgumentDeclarationList adl,
                                 CompoundStatement cs) : base((yyp))
 {
     ReturnType = returnType;
     m_name = name;
     kids.Add(adl);
     kids.Add(cs);
 }