Ejemplo n.º 1
0
        public static void ParseNode(CsNode pNode, CodeBuilder pSb, FactoryExpressionCreator pCreator)
        {
            CsBlock block = pNode as CsBlock;

            if (block != null)
            {
                Parse(block, pSb, pCreator);
                return;
            }

            CsStatement statement = pNode as CsStatement;

            if (statement != null)
            {
                pSb.Indent();
                parseStatement(statement, pSb, pCreator);
                pSb.Unindent();
                return;
            }

            CsExpression expression = pNode as CsExpression;

            if (expression != null)
            {
                Expression ex = pCreator.Parse(pNode as CsExpression);
                pSb.Append(ex.Value + ";");
                pSb.AppendLine();
                return;
            }

            throw new Exception();
        }
Ejemplo n.º 2
0
        public static void Parse(CsBlock pCsBlock, CodeBuilder pSb, FactoryExpressionCreator pCreator)
        {
            if (pCsBlock == null)
            {
                return;
            }

            pSb.Indent();

            if (pCsBlock.statements != null)
            {
                foreach (CsStatement statement in pCsBlock.statements)
                {
                    parseStatement(statement, pSb, pCreator);
                }
            }

            pSb.Unindent();
        }
Ejemplo n.º 3
0
		public static void Parse(CsBlock pCsBlock, CodeBuilder pSb, FactoryExpressionCreator pCreator) {
			if (pCsBlock == null) 
				return;

			pSb.Indent();

			if (pCsBlock.statements != null) {
				foreach (CsStatement statement in pCsBlock.statements) {
					parseStatement(statement, pSb, pCreator);
				}
			}

			pSb.Unindent();
		}