Exemplo n.º 1
0
        static public String checkElseStatements(IfStatementSyntax node)
        {
            String program = "";

            if (node.Else == null)
            {
                return(null);
            }
            ElseClauseSyntax newNode = node.Else;
            int nodes = newNode.DescendantNodes().OfType <StatementSyntax>().Count();

            if (nodes > 0 && newNode.DescendantNodes().OfType <StatementSyntax>().ElementAt(0).GetType().Name == "IfStatementSyntax")
            {
                String            programPart = "";
                IfStatementSyntax ifstatement = (IfStatementSyntax)newNode.DescendantNodes().OfType <StatementSyntax>().ElementAt(0);
                programPart += ReadIfStatement(ifstatement, true);
                program     += programPart;
            }
            else
            {
                String          programPart = "";
                StatementSyntax body        = newNode.Statement;
                programPart = program + strings["e-if"] + RemoveLines((String)ReadBlock(body)[0], 0, 1) + "\n" + strings["ee-if"];
                program    += programPart;
            }
            return(RemoveLines(program, 0, 1));
        }