Пример #1
0
 public override void EnterProcedureDeclaration([NotNull] ZealCpuParser.ProcedureDeclarationContext context)
 {
     _currentScope = _driver.GlobalScope.GetScope(context.name.Text);
 }
Пример #2
0
        public void Add(Scope scope)
        {
            scope.Parent = this;

            _children.Add(scope);
        }
Пример #3
0
 public override void EnterProcedureDeclaration([NotNull] ZealCpuParser.ProcedureDeclarationContext context)
 {
     _currentScope = new Scope();
     _currentScope.Name = context.name.Text;
     _currentScope.Type = ScopeType.Procedure;
 }
Пример #4
0
 public override void EnterInterruptDeclaration([NotNull] ZealCpuParser.InterruptDeclarationContext context)
 {
     _currentScope = new Scope();
     _currentScope.Name = context.name.Text;
     _currentScope.Type = ScopeType.Interrupt;
 }
Пример #5
0
 public override void ExitProcedureDeclaration([NotNull] ZealCpuParser.ProcedureDeclarationContext context)
 {
     _driver.GlobalScope.Add(_currentScope);
     _currentScope = null;
 }
Пример #6
0
        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;
        }