Inheritance: Tools.SYMBOL
        /// <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 retVal = new StringBuilder();
            // opening brace
            retVal.Append(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
                    retVal.Append(GenerateNode(kid));

            // closing brace
            m_braceCount--;

            retVal.Append(GenerateIndentedLine("}"));

            return retVal.ToString();
        }
Beispiel #2
0
 public Statement(Parser yyp, CompoundStatement cs) : base((yyp))
 {
     kids.Add(cs);
 }
Beispiel #3
0
 public StateEvent(Parser yyp, string name, CompoundStatement cs) : base((yyp))
 {
     m_name = name;
     kids.Add(cs);
 }
Beispiel #4
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);
 }
Beispiel #5
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);
 }