public SequenceRulePrefixedSequenceGenerator(SequenceRulePrefixedSequence seq, SequenceExpressionGenerator seqExprGen, SequenceGeneratorHelper seqHelper) { this.seq = seq; this.seqExprGen = seqExprGen; this.seqHelper = seqHelper; seqRule = seq.Rule; ArgumentExpressions = seqRule.ArgumentExpressions; ReturnVars = seqRule.ReturnVars; specialStr = seqRule.Special ? "true" : "false"; matchingPatternClassName = "GRGEN_ACTIONS." + TypesHelper.GetPackagePrefixDot(seqRule.Package) + "Rule_" + seqRule.Name; patternName = seqRule.Name; ruleName = "rule_" + TypesHelper.PackagePrefixedNameUnderscore(seqRule.Package, seqRule.Name); matchType = matchingPatternClassName + "." + NamesOfEntities.MatchInterfaceName(patternName); matchName = "match_" + seq.Id; matchesType = "GRGEN_LIBGR.IMatchesExact<" + matchType + ">"; matchesName = "matches_" + seq.Id; }
private static void PrintSequenceRulePrefixedSequence(SequenceRulePrefixedSequence seqRulePrefixedSequence, Sequence parent, PrintSequenceContext context) { if (!(parent is SequenceMultiRulePrefixedSequence)) { Console.Write("["); } Console.Write("for{"); PrintSequence(seqRulePrefixedSequence.Rule, seqRulePrefixedSequence, context); Console.Write(";"); PrintSequence(seqRulePrefixedSequence.Sequence, seqRulePrefixedSequence, context); Console.Write("}"); if (!(parent is SequenceMultiRulePrefixedSequence)) { Console.Write("]"); } }
public SequenceMultiRulePrefixedSequenceRewritingGenerator(SequenceMultiRulePrefixedSequence seqMulti, SequenceRulePrefixedSequence seqRulePrefixedSequence, SequenceExpressionGenerator seqExprGen, SequenceGeneratorHelper seqHelper) { this.seqMulti = seqMulti; // parent this.seqRulePrefixedSequence = seqRulePrefixedSequence; this.seqExprGen = seqExprGen; this.seqHelper = seqHelper; seqRule = seqRulePrefixedSequence.Rule; specialStr = seqRule.Special ? "true" : "false"; matchingPatternClassName = "GRGEN_ACTIONS." + TypesHelper.GetPackagePrefixDot(seqRule.Package) + "Rule_" + seqRule.Name; patternName = seqRule.Name; plainRuleName = TypesHelper.PackagePrefixedNameDoubleColon(seqRule.Package, seqRule.Name); ruleName = "rule_" + TypesHelper.PackagePrefixedNameUnderscore(seqRule.Package, seqRule.Name); matchType = matchingPatternClassName + "." + NamesOfEntities.MatchInterfaceName(patternName); matchName = "match_" + seqRule.Id; matchesType = "GRGEN_LIBGR.IMatchesExact<" + matchType + ">"; matchesName = "matches_" + seqRule.Id; seqHelper.BuildReturnParameters(seqRule, seqRule.ReturnVars, out returnParameterDeclarations, out returnArguments, out returnAssignments, out returnParameterDeclarationsAllCall, out intermediateReturnAssignmentsAllCall, out returnAssignmentsAllCall); }