public override void EnterBlock([NotNull] SBP.BlockContext context) { if (m_scopeStack.Count > 0) { m_scopeStack.Push(new ProcedureParsingScope(m_scopeStack.Peek(), "Block", ProcedureParsingScope.ScopeType.Block)); } else { m_procedureBaseScope = new ProcedureParsingScope(null, "Procedure", ProcedureParsingScope.ScopeType.Procedure); m_scopeStack.Push(m_procedureBaseScope); } m_expressionData.PushStackLevel("Block"); // "Livrem og seler" }
public override void ExitBlock([NotNull] SBP.BlockContext context) { m_expressionData.PopStackLevel(); // Just remove the level; it var block = m_scopeStack.Pop(); if (block.Type != ProcedureParsingScope.ScopeType.Procedure) { if (m_scopeStack.Peek().Type == ProcedureParsingScope.ScopeType.Block) { m_scopeStack.Peek().AddStatementCode(block.GetBlockCode()); } else { m_scopeStack.Peek().AddSubStatement(block); } } else { // End of procedure body. Handled in ExitProcedureBody(). } // var sub = m_scopeStack.Pop(); // m_scopeStack.Peek().AddStatementCode(sub.GetBlockCode()); }