예제 #1
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 = String.Empty;

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

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

            // closing brace
            m_braceCount--;
            retstr += GenerateIndentedLine("}");

            return retstr;
        }
예제 #2
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(SYMBOL previousSymbol, CompoundStatement cs)
        {
            string retstr = String.Empty;

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

            if (m_insertCoopTerminationChecks)
            {
                // We have to check in event functions as well because the user can manually call these.
                if (previousSymbol is GlobalFunctionDefinition 
                    || previousSymbol is WhileStatement 
                    || previousSymbol is DoWhileStatement 
                    || previousSymbol is ForLoop
                    || previousSymbol is StateEvent)
                retstr += GenerateIndentedLine(m_coopTerminationCheck);
            }

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

            // closing brace
            m_braceCount--;
            retstr += GenerateIndentedLine("}");

            return retstr;
        }
예제 #3
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 );
}
예제 #4
0
 public  Statement (Parser yyp, CompoundStatement  cs ):base(((LSLSyntax
)yyp)){ kids . Add ( cs );
}
예제 #5
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 );
}
예제 #6
0
 public  StateEvent (Parser yyp, string  name , CompoundStatement  cs ):base(((LSLSyntax
)yyp)){ m_name = name ;
 kids . Add ( cs );
}
예제 #7
0
 public  KeyIntIntArgStateEvent (Parser yyp, string  name , KeyIntIntArgumentDeclarationList  adl , CompoundStatement  cs ):base(((LSLSyntax
)yyp), name , adl , cs ){}
예제 #8
0
 public  VoidArgStateEvent (Parser yyp, string  name , CompoundStatement  cs ):base(((LSLSyntax
)yyp), name , cs ){}