private void treeView_AfterSelect(object sender, TreeViewEventArgs e) { TreeNode tn = treeView.SelectedNode; StatusLabel.Text = ""; PascalABCCompiler.SyntaxTree.syntax_tree_node syntax_tree_node = tn.Tag as PascalABCCompiler.SyntaxTree.syntax_tree_node; if (syntax_tree_node.source_context == null) { return; } StatusLabel.Text = syntax_tree_node.source_context.ToString() + string.Format("({0},+{1})", syntax_tree_node.source_context.Position, syntax_tree_node.source_context.Length); if (syntax_tree_node.source_context.FileName != null) { StatusLabel.Text += Path.GetFileName(syntax_tree_node.source_context.FileName); } if (Errors.Count > 0) { if (Errors[syntax_tree_node] != null) { StatusLabel.Text += string.Format(" [BAD{0}]", Errors[syntax_tree_node]); } } this.VisualEnvironmentCompiler.ExecuteSourceLocationAction( PascalABCCompiler.Tools.ConvertSourceContextToSourceLocation((syntaxTreeSelectComboBox.SelectedItem as SyntaxTreeSelectComboBoxItem).FileName, syntax_tree_node.source_context), SourceLocationAction.SelectAndGotoBeg); }
private void toolStripButton2_Click_1(object sender, EventArgs e) { List <Error> Errors = new List <Error>(); PascalABCCompiler.SyntaxTree.syntax_tree_node sn = ParseCurrent(Errors, ""); PascalABCCompiler.SyntaxTree.documentation_comment_list dt = ParseCurrent(Errors, "dt_") as PascalABCCompiler.SyntaxTree.documentation_comment_list; PascalABCCompiler.DocumentationConstructor docconst = new PascalABCCompiler.DocumentationConstructor(); Dictionary <PascalABCCompiler.SyntaxTree.syntax_tree_node, string> documentation = docconst.Construct(sn, dt); }
private void tsParsePart_Click(object sender, EventArgs e) { string FileName = (string)VisualEnvironmentCompiler.ExecuteAction(VisualEnvironmentCompilerAction.GetCurrentSourceFileName, null); string FileText = (string)VisualEnvironmentCompiler.Compiler.SourceFilesProvider(FileName, PascalABCCompiler.SourceFileOperation.GetText); List <Error> Errors = new List <Error>(); List <CompilerWarning> Warnings = new List <CompilerWarning>(); PascalABCCompiler.SyntaxTree.syntax_tree_node sn = VisualEnvironmentCompiler.StandartCompiler.ParsersController.Compile(FileName + "part_", FileText, Errors, Warnings, PascalABCCompiler.Parsers.ParseMode.Normal); if (Errors.Count > 0) { StatusLabel.Text = Errors.Count + " errors"; } syntaxTreeSelectComboBox.Items.Clear(); if (sn == null) { return; } syntaxTreeSelectComboBox.Items.Add(new SyntaxTreeSelectComboBoxItem(sn, FileName)); syntaxTreeSelectComboBox.SelectedIndex = 0; }
private void toolStripButton1_Click_1(object sender, EventArgs e) { List <Error> Errors = new List <Error>(); DateTime dt = DateTime.Now; PascalABCCompiler.SyntaxTree.syntax_tree_node sn = ParseCurrent(Errors, ""); StatusLabel.Text = string.Format("[{0}ms]", (DateTime.Now - dt).TotalMilliseconds); if (Errors.Count > 0) { StatusLabel.Text += Errors.Count + " errors"; } syntaxTreeSelectComboBox.Items.Clear(); if (sn == null) { return; } string FileName = (string)VisualEnvironmentCompiler.ExecuteAction(VisualEnvironmentCompilerAction.GetCurrentSourceFileName, null); syntaxTreeSelectComboBox.Items.Add(new SyntaxTreeSelectComboBoxItem(sn, FileName)); syntaxTreeSelectComboBox.SelectedIndex = 0; }
public SyntaxTreeSelectComboBoxItem(PascalABCCompiler.SyntaxTree.syntax_tree_node Node, string FileName) { this.Node=Node; this.FileName=FileName; }
public SyntaxTreeSelectComboBoxItem(PascalABCCompiler.SyntaxTree.syntax_tree_node Node, string FileName) { this.Node = Node; this.FileName = FileName; }