Exemple #1
0
		public  GlobalFunctionDefinition (Parser yyp, string  returnType , string  name , ArgumentDeclarationList  adl , CompoundStatement  cs ):base(((LSLSyntax
		                                                                                                                                               )yyp)){ m_returnType = returnType ;
			m_name = name ;
			kids . Add ( adl );
			kids . Add ( cs );
		}
Exemple #2
0
		public  StateEvent (Parser yyp, string  name , ArgumentDeclarationList  dal , CompoundStatement  cs ):base(((LSLSyntax
		                                                                                                            )yyp)){ m_name = name ;
			if (0< dal . kids . Count ) kids . Add ( dal );
			kids . Add ( cs );
		}
Exemple #3
0
		public  ArgumentDeclarationList (Parser yyp, ArgumentDeclarationList  adl , Declaration  d ):base(((LSLSyntax
		                                                                                                   )yyp)){ while (0< adl . kids . Count ) kids . Add ( adl . kids . Pop ());
			kids . Add ( d );
		}
        /// <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)
        {
            string retstr = "";

            int comma = adl.kids.Count - 1; // tells us whether to print a comma

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

            return retstr.ToString();
        }