public override void EnterProcedureDeclaration([NotNull] ZealCpuParser.ProcedureDeclarationContext context) { _currentScope = _driver.GlobalScope.GetScope(context.name.Text); }
public void Add(Scope scope) { scope.Parent = this; _children.Add(scope); }
public override void EnterProcedureDeclaration([NotNull] ZealCpuParser.ProcedureDeclarationContext context) { _currentScope = new Scope(); _currentScope.Name = context.name.Text; _currentScope.Type = ScopeType.Procedure; }
public override void EnterInterruptDeclaration([NotNull] ZealCpuParser.InterruptDeclarationContext context) { _currentScope = new Scope(); _currentScope.Name = context.name.Text; _currentScope.Type = ScopeType.Interrupt; }
public override void ExitProcedureDeclaration([NotNull] ZealCpuParser.ProcedureDeclarationContext context) { _driver.GlobalScope.Add(_currentScope); _currentScope = null; }
public override void ExitInterruptDeclaration([NotNull] ZealCpuParser.InterruptDeclarationContext context) { var rtiInstruction = new CpuInstructionStatement(); rtiInstruction.Opcode = CpuInstructions.rti; rtiInstruction.AddressingMode = CpuAddressingMode.Implied; _currentScope.Statements.Add(rtiInstruction); _driver.GlobalScope.Add(_currentScope); _currentScope = null; }