Example #1
0
 /// <summary>
 ///     Construct the program node.
 /// </summary>
 /// <param name="theProgram">THe program.</param>
 /// <param name="theParent">The parent.</param>
 /// <param name="theNodeType">The node type.</param>
 /// <param name="theName">The name of the node.</param>
 public EncogProgramNode(EncogGenProgram theProgram,
                         EncogTreeNode theParent, NodeType theNodeType,
                         String theName)
     : base(theProgram, theParent)
 {
     type = theNodeType;
     name = theName;
 }
 /// <summary>
 ///     Construct the program node.
 /// </summary>
 /// <param name="theProgram">THe program.</param>
 /// <param name="theParent">The parent.</param>
 /// <param name="theNodeType">The node type.</param>
 /// <param name="theName">The name of the node.</param>
 public EncogProgramNode(EncogGenProgram theProgram,
                         EncogTreeNode theParent, NodeType theNodeType,
                         String theName)
     : base(theProgram, theParent)
 {
     type = theNodeType;
     name = theName;
 }
 public override void Generate(EncogGenProgram program, bool shouldEmbed)
 {
     if (!shouldEmbed)
     {
         throw new AnalystCodeGenerationError(
             "Must embed when generating Javascript");
     }
     GenerateForChildren(program);
 }
 public override void Generate(EncogGenProgram program, bool shouldEmbed)
 {
     _embed = shouldEmbed;
     AddLine("namespace EncogGenerated");
     IndentLine("{");
     GenerateForChildren(program);
     GenerateImports(program);
     UnIndentLine("}");
 }
 /// <inheritdoc />
 public abstract void Generate(EncogGenProgram program, bool embed);
Example #6
0
 /// <summary>
 ///     Construct a tree node.
 /// </summary>
 /// <param name="theProgram">The program.</param>
 /// <param name="theParent">The parent.</param>
 public EncogTreeNode(EncogGenProgram theProgram,
                      EncogTreeNode theParent)
 {
     Program = theProgram;
     parent  = theParent;
 }
 /// <summary>
 ///     Construct a tree node.
 /// </summary>
 /// <param name="theProgram">The program.</param>
 /// <param name="theParent">The parent.</param>
 public EncogTreeNode(EncogGenProgram theProgram,
                      EncogTreeNode theParent)
 {
     Program = theProgram;
     parent = theParent;
 }
        private void GenerateImports(EncogGenProgram program)
        {
            var imports = new StringBuilder();
            foreach (String str in Includes)
            {
                imports.Append("import ");
                imports.Append(str);
                imports.Append(";\n");
            }

            imports.Append("\n");

            AddToBeginning(imports.ToString());
        }
 public override void Generate(EncogGenProgram program, bool shouldEmbed)
 {
     embed = shouldEmbed;
     GenerateForChildren(program);
     GenerateImports(program);
 }