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  Statement (Parser yyp, CompoundStatement  cs ):base(((LSLSyntax
		                                                             )yyp)){ kids . Add ( cs );
		}
Exemple #4
0
		public  StateEvent (Parser yyp, string  name , CompoundStatement  cs ):base(((LSLSyntax
		                                                                             )yyp)){ m_name = name ;
			kids . Add ( cs );
		}
        /// <summary>
        /// Generates the code for a CompoundStatement node.
        /// </summary>
        /// <param name="cs">The CompoundStatement node.</param>
        /// <returns>String containing C# code for CompoundStatement cs.</returns>
        private string GenerateCompoundStatement(CompoundStatement cs)
        {
            string  retstr = "";

            // opening brace
            retstr += GenerateIndentedLine("{");
            if (IsParentEnumerable)
                retstr += GenerateLine("if (CheckSlice()) yield return null;");
            m_braceCount++;

            foreach (SYMBOL kid in cs.kids)
                retstr += GenerateNode(kid);

            // closing brace
            m_braceCount--;

            retstr += GenerateIndentedLine("}");

            return retstr.ToString();
        }
Exemple #6
0
        /// <summary>
        /// Generates the code for a CompoundStatement node.
        /// </summary>
        /// <param name="cs">The CompoundStatement node.</param>
        /// <returns>String containing C# code for CompoundStatement cs.</returns>
        private string GenerateCompoundStatement(CompoundStatement cs)
        {
            string  retstr = "";

            // opening brace
            retstr += GenerateIndentedLine("{");
            m_braceCount++;

            foreach (SYMBOL kid in cs.kids)
                retstr += GenerateNode(kid);

            // closing brace
            m_braceCount--;

            retstr += GenerateIndentedLine("}");

            return retstr.ToString();
        }
Exemple #7
0
        /// <summary>
        ///   Generates the code for a CompoundStatement node.
        /// </summary>
        /// <param name = "cs">The CompoundStatement node.</param>
        /// <returns>String containing C# code for CompoundStatement cs.</returns>
        private string GenerateCompoundStatement(CompoundStatement cs)
        {
            string retstr = "";

            // opening brace
            retstr += GenerateIndentedLine("{");
//            if (IsParentEnumerable)
//                retstr += GenerateLine("if (CheckSlice()) yield return null;");
            m_braceCount++;

            foreach (SYMBOL kid in cs.kids)
                if (kid is Statement && kid.kids.Top is BinaryExpression &&
                    ((BinaryExpression) kid.kids.Top).ExpressionSymbol == "==")
                    continue;
                else
                    retstr += GenerateNode(kid);

            // closing brace
            m_braceCount--;

            retstr += GenerateIndentedLine("}");

            return retstr;
        }
        /// <summary>
        /// Generates the code for a CompoundStatement node.
        /// </summary>
        /// <param name="cs">The CompoundStatement node.</param>
        /// <returns>String containing C# code for CompoundStatement cs.</returns>
        private string GenerateCompoundStatement(CompoundStatement cs)
        {
            StringBuilder retstr = new StringBuilder();

            // opening brace
            retstr.Append(GenerateIndentedLine("{"));
            if (IsParentEnumerable)
                retstr.Append(GenerateLine("yield return null;"));
            m_braceCount++;

            foreach (SYMBOL kid in cs.kids)
                retstr.Append(GenerateNode(kid));

            // closing brace
            m_braceCount--;
                
            retstr.Append(GenerateIndentedLine("}"));

            return retstr.ToString();
        }