/// <summary>
 /// Generate a transducer rooted in def from a compound transducer definition and adds it to the list of transducers
 /// </summary>
 public bool AddTransducer(TransDefDef def, FastTransducerInstance fti, Dictionary<string, Def> defs)
 {
     var transducer = OperationTranGen.getTreeAutomatonFromExpr(def.expr, fti, defs);
     transducers.Add(def.func.name.text, transducer);
     if (transducer.IsEmpty)
         fti.fastLog.WriteLog(LogLevel.Normal, string.Format("the transducer '{0}' is empty", def.func.name.text));
     return true;
 }
Exemplo n.º 2
0
 //Generate CSharp for a definition of type TransDefDef
 private static bool GenerateTransductionDefinition(TransDefDef def, StringBuilder sb, AlphabetDef aDef)
 {
     int x;
     sb.AppendLine("public IEnumerable<Tree" + def.range.name + "> " + def.func.name + "(){");
     GenerateDefExpr(def.expr, sb, "this", 0, out x);
     sb.AppendLine("}");
     return true;
 }