Exemple #1
0
        /// <summary>
        /// Interpret MarkupStatement
        /// </summary>
        /// <param name="statement">MarkupStatement to interpret</param>
        public override void Visit(MarkupStatement statement)
        {
            //Determine if markup is a call
            if (IsCall(statement.GetMarkup()))
            {
                String functionIdentifier = statement.GetMarkup().GetDesignator().GetIdentifier();
                if (NodeContainsYield(SymbolTable.GetFunctionDefinition(functionIdentifier)))
                {   //Store null element, because there is nothing to yield in this statement
                    YieldStack.Push(null);
                }
            }

            //Interpret markup
            statement.GetMarkup().AcceptVisitor(this);
        }
Exemple #2
0
        public void ParseMarkupStatementTest()
        {
            //Create parser
            StatementParser statementParser = new StatementParser(Init("p();"));
            Statement       parsedStatement = statementParser.ParseMarkupStatement();

            //Test statatement
            Assert.AreEqual(typeof(MarkupStatement), parsedStatement.GetType());

            //Test MarkupStatement
            MarkupStatement statement = (MarkupStatement)parsedStatement;

            Assert.AreEqual("p", statement.GetMarkup().GetDesignator().GetIdentifier());
            Assert.AreEqual(0, statement.GetMarkup().GetArguments().Count);
        }