//public override void ResetOnAcquire() //{ // base.ResetOnAcquire(); // _generatedBlock = null; //} protected override void Translate() { //Create the command block _generatedBlock = CommandBlock.Create(Context.ActiveParentScope); Context.PushState(_generatedBlock.ChildCommandBlockScope); //Begin translation of the composite expression commands var nodeBlockExpressionCommandsList = RootParseNode.ChildNodes[0]; foreach (var subnode in nodeBlockExpressionCommandsList.ChildNodes) { GMacCommandGenerator.Translate(Context, subnode); } Context.PopState(); }
public static List <LanguageCommand> Translate(GMacSymbolTranslatorContext context, ParseTreeNode node) { context.PushState(node); var translator = new GMacCommandGenerator();//new GMacCommandGenerator(context); translator.SetContext(context); translator.Translate(); context.PopState(); var result = translator._generatedCommands; //MasterPool.Release(translator); return(result); }
protected override void Translate() { //Create the composite expression _generatedExpression = CompositeExpression.Create(Context.ActiveParentScope); Context.PushState(_generatedExpression.ChildCommandBlockScope); //Create the output variable for the composite expression Context.ActiveParentCompositeExpression.OutputVariable = translate_Identifier_Declaration(RootParseNode.ChildNodes[0]); //Translate the commands of the composite expression var nodeCommandBlockCommandsList = RootParseNode.ChildNodes[1]; foreach (var subNode in nodeCommandBlockCommandsList.ChildNodes) { GMacCommandGenerator.Translate(Context, subNode); } Context.PopState(); }