public void Handler(CmsCodeGenerator generator) { var exp = new ExpressionStatmentHandler(); exp.Handler(generator); var repeatStartReference = generator.RepeatReferenceStack.Pop(); var jf = (CmsCodeReference)CmsCodeFactory.JF(new CmsCode(generator.CodesLengh)); var jmp = CmsCodeFactory.JMP(repeatStartReference); generator.AddCode(jf); generator.AddCode(jmp); jf.Reference.ValueDecimal = generator.CodesLengh; generator.GeneratorState = TinyCodeGeneratorState.Initial; }
public void Handler(CmsCodeGenerator generator) { var startWhileReference = new CmsCode(generator.CodesLengh); var expressionStatmentHandler = new ExpressionStatmentHandler(); expressionStatmentHandler.Handler(generator); var cmsCodeReference = (CmsCodeReference)CmsCodeFactory.JF(new CmsCode(0X00)); generator.JFCodeReferenceStack.Push(cmsCodeReference); generator.AddCode(cmsCodeReference); var commeBackWhile = (CmsCodeReference)CmsCodeFactory.JMP(startWhileReference); generator.StartWhileCodeReference.Push(commeBackWhile); generator.GeneratorState = TinyCodeGeneratorState.Initial; }
private void GenerateVariableArea() { Token = Tokenization.GetTokenIgnoreSpace(); var jmpReference = new CmsCode(0X00); var jmp = CmsCodeFactory.JMP(jmpReference); AddCode(jmp); while (Token != null && !Token.IsBegin()) { if (Token.IsVar()) { Token = Tokenization.GetTokenIgnoreSpace(); VariableArea.Add(Token.Value, new CmsCode(CodesLengh)); Malock(); } Token = Tokenization.GetTokenIgnoreSpace(); } jmpReference.ValueDecimal = CodesLengh; }