コード例 #1
0
ファイル: lsl.parser.cs プロジェクト: osgrid/openmetaverse
 public Statement(Parser yyp, WhileStatement ifs)
     : base(((LSLSyntax
         )yyp))
 {
     kids.Add(ifs);
 }
コード例 #2
0
        /// <summary>
        /// Generates the code for a WhileStatement node.
        /// </summary>
        /// <param name="ws">The WhileStatement node.</param>
        /// <returns>String containing C# code for WhileStatement ws.</returns>
        private string GenerateWhileStatement(WhileStatement ws)
        {
            string retstr = String.Empty;

            retstr += GenerateIndented("while (", ws);
            retstr += GenerateNode((SYMBOL)ws.kids.Pop());
            retstr += GenerateLine(")");

            // CompoundStatement handles indentation itself but we need to do it
            // otherwise.
            bool indentHere = ws.kids.Top is Statement;
            if (indentHere) m_braceCount++;
            retstr += GenerateNode((SYMBOL)ws.kids.Pop());
            if (indentHere) m_braceCount--;

            return retstr;
        }