コード例 #1
0
ファイル: Parser.cs プロジェクト: TransistorLabs/GlowBeanGlow
        private void ProcessButtonEventFunction()
        {
            var buttonEventInstruction = new InstructionContext { Instruction = new ButtonEventInstruction() };

            var nextToken = GetNextToken();
            AssertValid(nextToken, "Expected: (", x => x.Type == TokenType.StartFunction);

            buttonEventInstruction.GotoLabel = ProcessLabelDefinition(false);

            nextToken = GetNextToken();
            AssertValid(nextToken, "expected: )",
                        x => x.Type == TokenType.EndFunction);

            nextToken = GetNextToken();
            AssertValid(nextToken, "expected: ;",
                        x => x.Type == TokenType.TerminateStatement);

            _instructionContextData.Add(buttonEventInstruction);
        }
コード例 #2
0
ファイル: Parser.cs プロジェクト: TransistorLabs/GlowBeanGlow
 private InstructionContext GetNewProgramInstruction(IInstruction instruction)
 {
     var p = new InstructionContext {Instruction = instruction};
     return p;
 }