Пример #1
0
 public override void CaseAASourceFile(AASourceFile node)
 {
     InAASourceFile(node);
     {
         Object[] temp = new Object[node.GetUsings().Count];
         node.GetUsings().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((PDecl)temp[i]).Apply(this);
         }
     }
     if (node.GetName() != null)
     {
         node.GetName().Apply(this);
     }
     {
         Object[] temp = new Object[node.GetDecl().Count];
         node.GetDecl().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((PDecl)temp[i]).Apply(this);
         }
     }
     OutAASourceFile(node);
 }
 public override void CaseAASourceFile(AASourceFile node)
 {
     writer.WriteLine(node.GetName().Text + ":");
     base.CaseAASourceFile(node);
 }
 public override void CaseAASourceFile(AASourceFile node)
 {
     string name = outputDir.FullName + "\\";
        /* if (Options.Compiler.OneOutputFile)
         name += "MapScript";
     else*/
         name += node.GetName().Text;
     name += ".galaxy";
     FileInfo file = new FileInfo(name);
     if (!file.Directory.Exists) file.Directory.Create();
     stream = new StreamWriter(file.Open(FileMode.Create));
     foreach (PDecl decl in node.GetDecl())
     {
         decl.Apply(this);
     }
     Write("", true);
     stream.Close();
 }
 public Error(Token pos, AASourceFile sourceFile, string message, bool warning = false, params TreeNode[] children)
 {
     this.pos = new TextPoint(pos.Line - 1, pos.Pos - 1);
     FileName = sourceFile == null || sourceFile.GetName() == null ? "Library file" : sourceFile.GetName().Text;
     Message = message;
     Warning = warning;
     Text = ToString();
     if (children.Length > 0)
         Nodes.AddRange(children);
     SelectedImageIndex = ImageIndex = warning ? 1 : 0;
 }