Refactoring of Compiler.cs (#2984)

* Add first comments

* Finish commenting for Compile and CompileUnit

* Write TODO sections

* Add a few clarifications

* splitted some functions from compile

* Written some methods from Compile to functions

* Update variable names

* Refactor - stage 1

Refactor GetUsesSection and IsPossibleNameSpace

* Refactor - stage 2

Rename a few functions and variables

* Correct an inaccuracy

* Added comments, look through CompileUnit

* Rename a few functions and add new comments

* Split CompileUnit to Subfunctions

Add IsUnitCompiled, IsUnitInPCU, InitializeNewUnit, GetSourceCode, GenSyntaxTree, GenUnitDocumentation, CheckDLLDirectiveOnlyForLibraries, MatchErrorsToBadNodes, CheckIfUnitModule, SetUseDLLForSystemUnits,
CompileInterfaceDependencies, CompileCurrentUnitInterface, GetImplementationUsesSection, CompileImplementationDependencies, CompileCurrentUnitImplementation

* Added some TODOs

* Return uses_unit_in original name

Renaming of syntax tree nodes leads to internal compiler errors

* Extract GenerateILCode method

* Add checking if recompilation needed method

Needs to be discussed and revised

* Add functions for catch blocks in Compile

* Extract building semantic tree method

Creating main function to be moved to another class

* Rename UnitsSortedList

* Edit CompileUnitsFromDelayedList method

* Change a few variable names, make CreateRCFile function and add comments

* Make code more "user-friendly"

* Add TODOs 31.11.23

* Create PrebuildSemanticTreeActionsMethod

* Refactor semantic checks section in initialize new unit method

* Refactor Adding standard units to uses method

* Return file_name and compiler_directives original names to avoid internal compilation errors

* Refactor GetReferences Method

* Initial refactoring of IncludeNamespaces function

* Create three more methods and wrap important code in regions

* Add TODO's

* Resolve merge conflicts

* Add returned value to ConstructSyntaxTree method

* Fix UnitsSortedList NotFoundError in PCUWriter

* Workaround commit

* Update PABCSystem after tests' changes

* Rename syntax trees in some methods

* Delete CurrentSyntaxUnit variable

* Revert unnecessary project files changes

* Squashed commit of the following:

commit f4d7599f1a39252feac97bd5391f46dfdc25f6f4
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 22 11:43:29 2023 +0300

    added links to identarranger

commit 3bd5d33e2b2969884e61a3279ff9c353013b57fe
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 22 11:43:03 2023 +0300

    Change extension for verybasic to yavb

commit 61294c6e7d405e1c68516cc81d3a109e8a1ee295
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Tue Nov 21 09:33:57 2023 +0300

    Change Program Example

commit 86971488341ed6bf13c39e13a513d7ac0c51c285
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Tue Nov 21 09:28:59 2023 +0300

    Add IndentArranger to Compile

commit 2ce50bbbf9db22c4243b247b870f6935ce206d26
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Fri Nov 17 10:00:31 2023 +0300

    Add Semicolon After Each Statement

commit 796309d340e8d8ba730ff9418fa376f34fb7fd36
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Wed Nov 15 18:49:11 2023 +0300

    Add Alpha Version of Python-style If-statement

commit 5eb88f946fe8254b4f5c5a56ed0a567b3be51227
Merge: ab4ce5b0 0162b637
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 15 16:54:26 2023 +0300

    Merge branch 'IndentArranger' into VeryBasicLanguage

commit ab4ce5b0e32d42004726e3dc45cc0d8a65e53f56
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 15 16:53:51 2023 +0300

    Fixes from seminar

commit af74012289d0d08517c13499a2a66cb543fc06d2
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Sun Nov 12 18:57:29 2023 +0300

    finally working!

    fully implemented compatibility

commit 58a39c313324b468d1eec207ba3f5f6eddf74ef2
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Sun Nov 12 11:58:16 2023 +0300

    more compatibility with pabc

    Now verybasic statements translate to pascal compiler
    added .bat script for autobuilding verybasic

commit 0162b6376b8fe970704f26213bf9f0f670dfb12e
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Sun Nov 12 10:06:14 2023 +0300

    Update test.txt

commit 1b759ab1cd7ee2ffeb14afff0418ddf0f30b0399
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Sun Nov 12 10:05:36 2023 +0300

    Add Indent and Unindent Keywords to Generated File

commit cabda7f3985651cff2a8740f1a5bdea8fe7ac892
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Fri Nov 10 21:25:52 2023 +0300

    Add Generation of Output File

commit 306f033d0176ab559e3622b8505427dbe2e0e203
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Thu Nov 9 20:42:18 2023 +0300

    Update IndentArranger.sln

commit 60c0ceced1aa3a7d2e33de0facb1126e295f43b5
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Thu Nov 9 20:41:22 2023 +0300

    Add IndentArranger

commit 1f4556c4573dae154fcc167b41ff6ab9e8122136
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Mon Nov 6 22:48:36 2023 +0300

    Made my own VeryBasicParser project

    Copied some code from SaushkinParser
    Tried to compile it and implement into Pascal
    Doesn't work due to grammatik issue

* Squashed commit of the following:

commit 4e73d9ac3ffef68312f06a74dc83afffcf3ccbee
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 22 15:08:10 2023 +0300

    Fixed GPPG (i think so at least)

commit e5cfc220828b37fb2f35e565683019716ec3f0ce
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 22 11:44:27 2023 +0300

    Update Compiler.cs

commit 4698e2e75a5f3b4f523a8bc7733a50e8abb4fca1
Merge: 22aaf2b2 f4d7599f
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 22 11:43:54 2023 +0300

    Merge branch 'IndentArrangerTemp' into VeryBasicLanguage

commit f4d7599f1a39252feac97bd5391f46dfdc25f6f4
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 22 11:43:29 2023 +0300

    added links to identarranger

commit 3bd5d33e2b2969884e61a3279ff9c353013b57fe
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 22 11:43:03 2023 +0300

    Change extension for verybasic to yavb

commit 22aaf2b2508278a9ffce525ffed52419bf72c23f
Merge: c326174f 61294c6e
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 22 11:26:36 2023 +0300

    Merge branch 'IndentArrangerTemp' into VeryBasicLanguage

commit 61294c6e7d405e1c68516cc81d3a109e8a1ee295
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Tue Nov 21 09:33:57 2023 +0300

    Change Program Example

commit 86971488341ed6bf13c39e13a513d7ac0c51c285
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Tue Nov 21 09:28:59 2023 +0300

    Add IndentArranger to Compile

commit c326174ff5ecccf9c4f76d58aea4653f047af049
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Sun Nov 19 15:03:19 2023 +0300

    Added UniversalParserHelper and GPPG

    ShiftReduceParser moved to another project
    UniversalParserHelper project added, most of it copied from SaushkinParser

commit 2ce50bbbf9db22c4243b247b870f6935ce206d26
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Fri Nov 17 10:00:31 2023 +0300

    Add Semicolon After Each Statement

commit 796309d340e8d8ba730ff9418fa376f34fb7fd36
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Wed Nov 15 18:49:11 2023 +0300

    Add Alpha Version of Python-style If-statement

commit 5eb88f946fe8254b4f5c5a56ed0a567b3be51227
Merge: ab4ce5b0 0162b637
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 15 16:54:26 2023 +0300

    Merge branch 'IndentArranger' into VeryBasicLanguage

commit ab4ce5b0e32d42004726e3dc45cc0d8a65e53f56
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Wed Nov 15 16:53:51 2023 +0300

    Fixes from seminar

commit af74012289d0d08517c13499a2a66cb543fc06d2
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Sun Nov 12 18:57:29 2023 +0300

    finally working!

    fully implemented compatibility

commit 58a39c313324b468d1eec207ba3f5f6eddf74ef2
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Sun Nov 12 11:58:16 2023 +0300

    more compatibility with pabc

    Now verybasic statements translate to pascal compiler
    added .bat script for autobuilding verybasic

commit 0162b6376b8fe970704f26213bf9f0f670dfb12e
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Sun Nov 12 10:06:14 2023 +0300

    Update test.txt

commit 1b759ab1cd7ee2ffeb14afff0418ddf0f30b0399
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Sun Nov 12 10:05:36 2023 +0300

    Add Indent and Unindent Keywords to Generated File

commit cabda7f3985651cff2a8740f1a5bdea8fe7ac892
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Fri Nov 10 21:25:52 2023 +0300

    Add Generation of Output File

commit 306f033d0176ab559e3622b8505427dbe2e0e203
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Thu Nov 9 20:42:18 2023 +0300

    Update IndentArranger.sln

commit 60c0ceced1aa3a7d2e33de0facb1126e295f43b5
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date:   Thu Nov 9 20:41:22 2023 +0300

    Add IndentArranger

commit 1f4556c4573dae154fcc167b41ff6ab9e8122136
Author: Владислав Крылов <krylov@sfedu.ru>
Date:   Mon Nov 6 22:48:36 2023 +0300

    Made my own VeryBasicParser project

    Copied some code from SaushkinParser
    Tried to compile it and implement into Pascal
    Doesn't work due to grammatik issue

* Changed GPPG project NET Framework version, added .dll to gitignore

* Adding UniversalParserHelper to project, trying to include VeryBasic

* Managed dependencies and got VeryBasicLanguage to work

* Change extension of a test program

* Rebuild changes

What should be added to .gitignore?

* Fix bug related to err0524_res_unit.pas

* Rebuild Parser

* Change Indent and Unindent tokens

* Add Symbol Table to ParserABC.y

* Change Indent Space Number to 2

* Add While Loop

* Add Some Operations to Parser

* Make Initialization Node at the Beginning of a program

* Create Grammar.txt

* Test program added

* Add ELIF and SyntaxHighlight

* Fix TableSymbol

* Add Division

* Add Method Call

* Add For Loop

* Rename SPython Parser Folder

* Add documented comments for CompileUnit method

* Added Errors to SPython

Added Errors.cs
Removed link to PABCSaushkinParser
Minor fixes

* Create default constructor for SourceContext

* Move null check of currentUnit to upper level in CompileUnit

* Move CreateMainFunction method from Compiler to TreeConverter class

* Add gppg and parserhelper to visualpascalabcnet dependencies

* Updated installer files to include GPPG and UniversalParserHelper

* Rename GPPG to ShiftReduceParser

* Fix ShiftReduceParser project dependencies

* Fix ShiftReduceParserDependencies second iteration

* Workaround commit

* Update PABCSystem after tests' changes

* Refactor ConvertDirectives method

* Get rid of legacy standard modules code

* Return varBeginOffset and beginOffset calculation to Compiler class

Размещение метода в SyntaxTreeToSemanticTreeConverter не целесообразно. В комментарии видимо имелось в виду что-то другое.

* Workaround commit

* Update PABCSystem after tests' changes

* Revert SPython changes

Оставляем только изменения связанные с рефакторингом.

* Update .gitignore

Co-authored-by: Sun Serega <sunserega2@gmail.com>

* Resolve a few Sun Serega treds

* Delete comments in ParsersController.cs

* Replace specific path with path variable in Studio.bat

* Add comment in Studio.bat file and return FileName in CompilerError.cs

* Fix TreeSubsidiary.cs encoding and sectCore.nsh indents

* Return old version of TestRunner.exe

* Rename some variables and polish a few methods

* Uncomment accidentally commented code

* Replace spaces with tabs

* Changed dll name from GPPG

* Revert "Changed dll name from GPPG"

This reverts commit c485cc8cb787809b7e9dfa8a361e75f17ed39893.

* Update .gitignore

* Delete Libraries/ShiftReduceParser.dll

* Delete bin\ShiftReduceParser.dll

* Replace tabs with spaces

* Update encoding in Studio.bat

* Fix bug with PABCrtl excluded files

* Refactor StandardModule class

* Add null checks to make debuging easier

* Delete unnecessary null checks in SymTable.cs

---------

Co-authored-by: Владислав Крылов <krylov@sfedu.ru>
Co-authored-by: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Co-authored-by: Sun Serega <sunserega2@gmail.com>
This commit is contained in:
AlexanderZemlyak 2023-12-18 22:33:27 +03:00 committed by GitHub
parent be62347a2a
commit 0c29ac92b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
97 changed files with 3315 additions and 2213 deletions

2
.gitignore vendored
View file

@ -37,6 +37,7 @@
**/CompilerController.dll
**/CompilerTools.dll
**/Errors.dll
**/ShiftReduceParser.dll
**/HelpBuilder.dll
**/InternalErrorReport.dll
**/LambdaAnySynToSemConverter.dll
@ -70,6 +71,7 @@
**/PascalABCNET.exe.config
**/PascalABCNETLinux.exe
**/PascalABCNETLinux.exe.config
**/UniversalParserHelper.dll

View file

@ -133,8 +133,8 @@ namespace CodeCompletion
Warnings.Clear();
try
{
//cu = ParsersController.GetComilationUnit(FileName, Text+")))));end.",comp.CompilerOptions.ParserSearchPatchs,ErrorsList);
//cu = ParsersControllerGetComilationUnit(FileName, get_temp_text(Text), ErrorsList, true);
//cu = ParsersController.GetComilationUnit(file_name, Text+")))));end.",comp.CompilerOptions.ParserSearchPatchs,ErrorsList);
//cu = ParsersControllerGetComilationUnit(file_name, get_temp_text(Text), ErrorsList, true);
string tmp = ParsersHelper.GetModifiedProgramm(Text);
if (tmp != null)
{
@ -164,7 +164,7 @@ namespace CodeCompletion
}
}
if (docs != null) docs.Clear();
//if (dconv.is_compiled) comp_modules[FileName]=dconv;
//if (dconv.is_compiled) comp_modules[file_name]=dconv;
return dconv;
//ConvertToDom(cu);
}
@ -233,7 +233,7 @@ namespace CodeCompletion
{
ErrorsList.Clear();
Warnings.Clear();
//cu = ParsersControllerGetComilationUnit(FileName, Text, ErrorsList, true);
//cu = ParsersControllerGetComilationUnit(file_name, Text, ErrorsList, true);
if (comp_modules[FileName] == null)
{
string tmp = ParsersHelper.GetModifiedProgramm(Text);
@ -260,7 +260,7 @@ namespace CodeCompletion
dconv.ConvertToDom(cu);
}
}
//comp_modules[FileName] = dconv;
//comp_modules[file_name] = dconv;
if (dconv.is_compiled) comp_modules[FileName] = dconv;
if (docs != null) docs.Clear();
@ -299,7 +299,7 @@ namespace CodeCompletion
{
ErrorsList.Clear();
Warnings.Clear();
//cu = ParsersControllerGetComilationUnit(FileName, Text, ErrorsList, true);
//cu = ParsersControllerGetComilationUnit(file_name, Text, ErrorsList, true);
if (comp_modules[FileName] == null)
{
string tmp = ParsersHelper.GetModifiedProgramm(Text);
@ -327,7 +327,7 @@ namespace CodeCompletion
}
if (dconv.is_compiled) comp_modules[FileName] = dconv;
if (docs != null) docs.Clear();
//comp_modules[FileName] = dconv;
//comp_modules[file_name] = dconv;
// GC.Collect();
return dconv;
}
@ -376,8 +376,10 @@ namespace CodeCompletion
const string LibSourceDirectoryIdent = "%LIBSOURCEDIRECTORY%";
public static string FindSourceFileName(string unit_name, out int found_dir_ind, params string[] ddirs)
{
// TODO: check error in older version
List<string> Dirs = new List<string>();
Dirs.AddRange(ddirs);
if (CodeCompletionController.comp != null)
Dirs.AddRange(CodeCompletionController.comp.CompilerOptions.SearchDirectory);
if (CodeCompletionController.StandartDirectories.ContainsKey(LibSourceDirectoryIdent))
Dirs.Add((string)CodeCompletionController.StandartDirectories[LibSourceDirectoryIdent]);

View file

@ -4829,7 +4829,7 @@ namespace CodeCompletion
{
//throw new Exception("The method or operation is not implemented.");
SymScope tmp = cur_scope;
unl.clear();
unl.Clear();
cur_scope = new ImplementationUnitScope(new SymInfo("$implementation", SymbolKind.Namespace, "implementation"), cur_scope);
tmp.AddName("$implementation", cur_scope);
(tmp as InterfaceUnitScope).impl_scope = cur_scope as ImplementationUnitScope;

View file

@ -5250,7 +5250,7 @@ namespace CodeCompletion
{
this.name = name;
this.si = new SymInfo(name, SymbolKind.Namespace, name);
this.si.description = CodeCompletionController.CurrentParser.LanguageInformation.GetDescription(this);
this.si.description = CodeCompletionController.CurrentParser?.LanguageInformation.GetDescription(this);
}
public override ScopeKind Kind
@ -5559,7 +5559,7 @@ namespace CodeCompletion
}
if (si.name == null)
AssemblyDocCache.AddDescribeToComplete(this.si, ctn);
this.si.name = CodeCompletionController.CurrentParser.LanguageInformation.GetShortName(this);
this.si.name = CodeCompletionController.CurrentParser?.LanguageInformation.GetShortName(this);
this.si.kind = get_kind();
this.si.description = GetDescription();
@ -6196,7 +6196,7 @@ namespace CodeCompletion
public override string GetDescription()
{
return CodeCompletionController.CurrentParser.LanguageInformation.GetDescription(this);
return CodeCompletionController.CurrentParser?.LanguageInformation.GetDescription(this);
}
public override SymInfo[] GetNames(ExpressionVisitor ev, PascalABCCompiler.Parsers.KeywordKind keyword, bool called_in_base)

File diff suppressed because it is too large Load diff

View file

@ -24,7 +24,7 @@ namespace PascalABCCompiler
try
{
this.cu = cu;
is_assembly = cu.SyntaxTree is SyntaxTree.program_module || Compiler.is_dll(cu.SyntaxTree);
is_assembly = cu.SyntaxTree is SyntaxTree.program_module || Compiler.IsDll(cu.SyntaxTree);
XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8;
settings.Indent = true;

View file

@ -259,7 +259,7 @@ namespace PascalABCCompiler.PCU
PCUReader pr = (PCUReader)units[FileName];
if (pr != null) return pr.unit;
if (!File.Exists(FileName)) return null;
//fs = new FileStream(FileName, FileMode.Open, FileAccess.Read);
//fs = new FileStream(file_name, FileMode.Open, FileAccess.Read);
ms = new MemoryStream(File.ReadAllBytes(FileName));
br = new BinaryReader(ms);
ReadPCUHeader();
@ -274,7 +274,7 @@ namespace PascalABCCompiler.PCU
CloseUnit();
this.unit = null;
need = true;
return null; // return comp.RecompileUnit(FileName);
return null; // return comp.RecompileUnit(file_name);
}
ChangeState(this, PCUReaderWriterState.BeginReadTree, unit);
cun.scope = new WrappedUnitInterfaceScope(this);
@ -369,7 +369,7 @@ namespace PascalABCCompiler.PCU
{
var sub_u = pr.GetCompilationUnit(used_unit_fname, this.readDebugInfo);
if (sub_u == null) return true;
this.unit.DirectInterfaceCompilationUnits.Add(sub_u.SemanticTree, sub_u);
this.unit.InterfaceUsedDirectUnits.Add(sub_u.SemanticTree, sub_u);
this.unit.InterfaceUsedUnits.AddElement(sub_u.SemanticTree, pcu_file.incl_modules[i]);
}
}

View file

@ -885,7 +885,7 @@ namespace PascalABCCompiler.PCU
comp_cnn = (tn as common_generic_instance_type_node).common_original_generic.comprehensive_namespace;
if (comp_cnn != null && !ns_dict.ContainsKey(comp_cnn) && unit.SemanticTree != comp_cnn.cont_unit)
{
var path = Compiler.GetUnitPath(unit, compiler.UnitsSortedList.Find(u => u.SemanticTree == comp_cnn.cont_unit));
var path = Compiler.GetUnitPath(unit, compiler.UnitsLogicallySortedList.Find(u => u.SemanticTree == comp_cnn.cont_unit));
if (interf)
unit.InterfaceUsedUnits.AddElement(comp_cnn.cont_unit, path);
@ -904,7 +904,7 @@ namespace PascalABCCompiler.PCU
common_namespace_node comp_cnn = cnfn.namespace_node;
if (comp_cnn != null && !ns_dict.ContainsKey(comp_cnn) && unit.SemanticTree != comp_cnn.cont_unit)
{
var path = Compiler.GetUnitPath(unit, compiler.UnitsSortedList.Find(u => u.SemanticTree == comp_cnn.cont_unit));
var path = Compiler.GetUnitPath(unit, compiler.UnitsLogicallySortedList.Find(u => u.SemanticTree == comp_cnn.cont_unit));
if (interf)
unit.InterfaceUsedUnits.AddElement(comp_cnn.cont_unit, path);

View file

@ -388,7 +388,7 @@ namespace PascalABCCompiler
sendCommand(ConsoleCompilerConstants.CompilerOptionsClearStandartModules);
if (compilerOptions.Locale != null)
sendCommand(ConsoleCompilerConstants.CompilerLocale, compilerOptions.Locale);
foreach (PascalABCCompiler.CompilerOptions.StandartModule sm in compilerOptions.StandartModules)
foreach (PascalABCCompiler.CompilerOptions.StandardModule sm in compilerOptions.StandardModules)
sendCommand(
ConsoleCompilerConstants.CompilerOptionsStandartModule,
sm.Name,(int)sm.AddMethod,(int)sm.AddToLanguages);

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "9";
public const string Build = "0";
public const string Revision = "3390";
public const string Revision = "3391";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=0
%REVISION%=3390
%MINOR%=9
%REVISION%=3391
%COREVERSION%=0
%MAJOR%=3

View file

@ -51,8 +51,8 @@ namespace PascalABCCompiler.Errors
if (source_context != null)
pos = "(" + source_context.begin_position.line_num + "," + source_context.begin_position.column_num + ")";
string fn = null;
if (FileName != null)
fn = Path.GetFileName(FileName);
if (file_name != null)
fn = Path.GetFileName(file_name);
return string.Format(StringResources.Get("PARSER_ERRORS_COMPILATION_ERROR{0}{1}{2}"), fn, pos, Message);
*/
return (new CompilerInternalError("Errors.ToString",new Exception(string.Format("Не переопеределена {0}.ToString",this.GetType())))).ToString();

Binary file not shown.

Binary file not shown.

View file

@ -22,7 +22,7 @@ namespace PascalABCCompiler.CodeGenerators
{
private NETGenerator.ILConverter il_converter;//=new NETGenerator.ILConverter();
public void Compile(SemanticTree.IProgramNode ProgramTree,string TargetFileName,string SourceFileName ,
public void GenerateILCodeAndSaveAssembly(SemanticTree.IProgramNode ProgramTree,string TargetFileName,string SourceFileName ,
NETGenerator.CompilerOptions options, Hashtable StandartDirectories, string[] ResourceFiles)
{
il_converter = new NETGenerator.ILConverter(StandartDirectories);

View file

@ -5,6 +5,8 @@ using System.IO;
using PascalABCCompiler.ParserTools;
using PascalABCCompiler.Errors;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace PascalABCCompiler.Parsers
{
@ -27,22 +29,6 @@ namespace PascalABCCompiler.Parsers
IParser pc = null;
foreach (FileInfo fi in dllfiles)
{
/*if (Path.GetFileName(fi.FullName)=="PascalABCParser.dll" &&
string.Compare(Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().ManifestModule.FullyQualifiedName),"PascalABCNET.exe",true)==0)
continue;
else
if (Path.GetFileName(fi.FullName)=="PascalABCPartParser.dll" &&
string.Compare(Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().ManifestModule.FullyQualifiedName),"pabcnetc.exe",true)==0)
continue;*/
//if (Path.GetFileName(fi.FullName) != "PascalABCParser.dll" && Path.GetFileName(fi.FullName) != "VBNETParser.dll")
// continue;
//if (Path.GetFileName(fi.FullName) == "VBNETParser.dll" || Path.GetFileName(fi.FullName) == "PascalABCPartParser.dll")
//if (Path.GetFileName(fi.FullName) != "PascalABCParser.dll" && Path.GetFileName(fi.FullName) != "VBNETParser.dll")
// continue;
//if (Path.GetFileName(fi.FullName) == "PascalABCPartParser.dll")
// continue;
//if (Path.GetFileName(fi.FullName) != "PascalABCParser.dll" /*&& Path.GetFileName(fi.FullName) != "VBNETParser.dll"*/)
// continue;
if (Path.GetFileName(fi.FullName) == "VBNETParser.dll" || Path.GetFileName(fi.FullName) == "PascalABCPartParser.dll")
continue;
asssembly = System.Reflection.Assembly.LoadFile(fi.FullName);
@ -142,6 +128,7 @@ namespace PascalABCCompiler.Parsers
return null;
if (cu is SyntaxTree.compilation_unit)
return cu as SyntaxTree.compilation_unit;
Errors.Add(new Errors.UnexpectedNodeType(FileName, cu.source_context,null));
return null;
//throw new Errors.CompilerInternalError("Parsers.Controller.GetComilationUnit", new Exception("bad node type"));

View file

@ -21,8 +21,8 @@ namespace PascalABCCompiler
{
case SourceFileOperation.GetText:
if (!File.Exists(FileName)) return null;
/*TextReader tr = new StreamReader(FileName, System.Text.Encoding.GetEncoding(1251));
//TextReader tr = new StreamReader(FileName, System.Text.Encoding.);
/*TextReader tr = new StreamReader(file_name, System.Text.Encoding.GetEncoding(1251));
//TextReader tr = new StreamReader(file_name, System.Text.Encoding.);
string Text = tr.ReadToEnd();
tr.Close();*/
string Text = FileReader.ReadFileContent(FileName, null);

View file

@ -788,7 +788,7 @@ namespace CodeCompletionTools
public static XmlDoc Load(string fileName, string cachePath, bool ru)
{
//LoggingService.Debug("Loading XmlDoc for " + fileName);
//LoggingService.Debug("Loading XmlDoc for " + file_name);
XmlDoc doc;
string cacheName = null;
if (cachePath != null) {
@ -814,12 +814,12 @@ namespace CodeCompletionTools
doc = Load(xmlReader);
}
} catch (XmlException ex) {
//LoggingService.Warn("Error loading XmlDoc " + fileName, ex);
//LoggingService.Warn("Error loading XmlDoc " + file_name, ex);
return new XmlDoc();
}
if (cachePath != null && doc.xmlDescription.Count > cacheLength * 2) {
//LoggingService.Debug("XmlDoc: Creating cache for " + fileName);
//LoggingService.Debug("XmlDoc: Creating cache for " + file_name);
DateTime date = File.GetLastWriteTimeUtc(fileName);
try {
doc.Save(cacheName, date);

View file

@ -190,7 +190,7 @@ namespace PascalABCCompiler.PascalABCNewParser
Errors.Clear();
Warnings.Clear();
/*string[] file_names = new string[1];
file_names[0] = FileName;
file_names[0] = file_name;
preprocessor2.Build(file_names, Errors, null);*/

View file

@ -111,9 +111,6 @@
<Compile Include="Preprocessor3Yacc.cs" />
<Compile Include="PreprocessorTools.cs" />
<Compile Include="SemanticRules.cs" />
<Compile Include="ShiftReduceParserCode.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Errors\Errors.csproj">
@ -128,6 +125,10 @@
<Project>{AF2EFD7B-69DD-4B43-AF65-B59B29349C23}</Project>
<Name>ParserTools</Name>
</ProjectReference>
<ProjectReference Include="..\..\ShiftReduceParser\ShiftReduceParser.csproj">
<Project>{ad4e1292-2537-467a-934d-e9fda3f18d87}</Project>
<Name>ShiftReduceParser</Name>
</ProjectReference>
<ProjectReference Include="..\..\SyntaxTree\SyntaxTree.csproj">
<Project>{C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A}</Project>
<Name>SyntaxTree</Name>

View file

@ -1,13 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1000
# Visual Studio Version 17
VisualStudioVersion = 17.8.34309.116
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VisualPascalABCNET", "VisualPascalABCNET", "{26843C5D-9D7E-4C2C-AC14-2D227FA5592E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginsSupport", "PluginsSupport\PluginsSupport.csproj", "{CFC683F8-0165-4A9F-9C3F-BB8C5BAB507F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualPascalABCNET", "VisualPascalABCNET\VisualPascalABCNET.csproj", "{BC35F816-54EE-47E0-89FC-1C66EAC155A9}"
ProjectSection(ProjectDependencies) = postProject
{AD4E1292-2537-467A-934D-E9FDA3F18D87} = {AD4E1292-2537-467A-934D-E9FDA3F18D87}
{E862A9EF-836B-414B-AAC4-9D207CABDC82} = {E862A9EF-836B-414B-AAC4-9D207CABDC82}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{EC68A3D8-6D63-4A79-ABA6-BF8E9D7756D7}"
EndProject
@ -18,8 +22,8 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompilerController", "VisualPlugins\CompilerController\CompilerController.csproj", "{50F4AB3F-0A1E-4AF9-88CF-48A8D3E1D1D7}"
ProjectSection(ProjectDependencies) = postProject
{1E42361A-EDA3-4872-88AF-A3AAF600D36D} = {1E42361A-EDA3-4872-88AF-A3AAF600D36D}
{CFC683F8-0165-4A9F-9C3F-BB8C5BAB507F} = {CFC683F8-0165-4A9F-9C3F-BB8C5BAB507F}
{A25D26FB-3043-4BCF-833E-E3F4C3BE795E} = {A25D26FB-3043-4BCF-833E-E3F4C3BE795E}
{CFC683F8-0165-4A9F-9C3F-BB8C5BAB507F} = {CFC683F8-0165-4A9F-9C3F-BB8C5BAB507F}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternalErrorReport", "VisualPlugins\InternalErrorReport\InternalErrorReport.csproj", "{A36031B7-D3D1-4372-B478-07621069602E}"
@ -85,8 +89,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.WinForms",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PABCNETCclear", "pabcnetc_clear\PABCNETCclear.csproj", "{146083AD-6684-4EBC-A539-AAD749A16364}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PascalABCSaushkinParser", "Parsers\PascalABCParserNewSaushkin\PascalABCSaushkinParser.csproj", "{1443F539-DCC7-4491-B4FD-B716C739DB3C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DA0402DA-D618-47B4-8BF0-2959D16F2160}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyntaxTreeConverters", "SyntaxTreeConverters\SyntaxTreeConverters.csproj", "{F10A5330-DCF4-4533-877C-7B1B1BE23884}"
@ -107,6 +109,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeacherControlPlugin", "Vis
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaAnySynToSemConverter", "LambdaAnySynToSemConverter\LambdaAnySynToSemConverter.csproj", "{27D9800E-2689-4AA1-A2D6-128E4A9BAE98}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftReduceParser", "ShiftReduceParser\ShiftReduceParser.csproj", "{AD4E1292-2537-467A-934D-E9FDA3F18D87}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PascalABCSaushkinParser", "Parsers\PascalABCParserNewSaushkin\PascalABCSaushkinParser.csproj", "{1443F539-DCC7-4491-B4FD-B716C739DB3C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalParserHelper", "UniversalParserHelper\UniversalParserHelper.csproj", "{E862A9EF-836B-414B-AAC4-9D207CABDC82}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -387,16 +395,6 @@ Global
{146083AD-6684-4EBC-A539-AAD749A16364}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{146083AD-6684-4EBC-A539-AAD749A16364}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{146083AD-6684-4EBC-A539-AAD749A16364}.Release|x86.ActiveCfg = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|x86.ActiveCfg = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|Any CPU.Build.0 = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|x86.ActiveCfg = Release|Any CPU
{F10A5330-DCF4-4533-877C-7B1B1BE23884}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F10A5330-DCF4-4533-877C-7B1B1BE23884}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F10A5330-DCF4-4533-877C-7B1B1BE23884}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@ -501,6 +499,42 @@ Global
{27D9800E-2689-4AA1-A2D6-128E4A9BAE98}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{27D9800E-2689-4AA1-A2D6-128E4A9BAE98}.Release|x86.ActiveCfg = Release|Any CPU
{27D9800E-2689-4AA1-A2D6-128E4A9BAE98}.Release|x86.Build.0 = Release|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Debug|x86.ActiveCfg = Debug|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Debug|x86.Build.0 = Debug|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Release|Any CPU.Build.0 = Release|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Release|x86.ActiveCfg = Release|Any CPU
{AD4E1292-2537-467A-934D-E9FDA3F18D87}.Release|x86.Build.0 = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|x86.ActiveCfg = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Debug|x86.Build.0 = Debug|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|Any CPU.Build.0 = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|x86.ActiveCfg = Release|Any CPU
{1443F539-DCC7-4491-B4FD-B716C739DB3C}.Release|x86.Build.0 = Release|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Debug|x86.ActiveCfg = Debug|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Debug|x86.Build.0 = Debug|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Release|Any CPU.Build.0 = Release|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Release|x86.ActiveCfg = Release|Any CPU
{E862A9EF-836B-414B-AAC4-9D207CABDC82}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -536,7 +570,6 @@ Global
{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9} = {A5A3667E-8A3B-4569-BA0E-AD49E12D07E7}
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288} = {A5A3667E-8A3B-4569-BA0E-AD49E12D07E7}
{146083AD-6684-4EBC-A539-AAD749A16364} = {F8CE2712-826B-450B-A72F-D32D80C99858}
{1443F539-DCC7-4491-B4FD-B716C739DB3C} = {BB6973BA-B3A2-4B31-A986-7CB008F22C4F}
{F10A5330-DCF4-4533-877C-7B1B1BE23884} = {F8CE2712-826B-450B-A72F-D32D80C99858}
{CE5C55C2-A11C-4E94-A9FA-3FC6CA3E4C09} = {F8CE2712-826B-450B-A72F-D32D80C99858}
{A9AB4282-83B4-41A7-86C3-E5BF6A45E7E2} = {F8CE2712-826B-450B-A72F-D32D80C99858}
@ -546,6 +579,9 @@ Global
{E009E776-9280-4061-B5CA-7F0C3E2D3C2A} = {26843C5D-9D7E-4C2C-AC14-2D227FA5592E}
{536CC813-7C4E-42BC-AE3A-BA1427F38756} = {EC68A3D8-6D63-4A79-ABA6-BF8E9D7756D7}
{27D9800E-2689-4AA1-A2D6-128E4A9BAE98} = {F8CE2712-826B-450B-A72F-D32D80C99858}
{AD4E1292-2537-467A-934D-E9FDA3F18D87} = {F8CE2712-826B-450B-A72F-D32D80C99858}
{1443F539-DCC7-4491-B4FD-B716C739DB3C} = {BB6973BA-B3A2-4B31-A986-7CB008F22C4F}
{E862A9EF-836B-414B-AAC4-9D207CABDC82} = {F8CE2712-826B-450B-A72F-D32D80C99858}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {68E993E6-EE86-4DDF-B0A1-4FE884F8AC39}

View file

@ -1 +1 @@
3.9.0.3390
3.9.0.3391

View file

@ -1 +1 @@
!define VERSION '3.9.0.3390'
!define VERSION '3.9.0.3391'

View file

@ -5,6 +5,7 @@
File "..\bin\Compiler.dll"
File "..\bin\CompilerTools.dll"
File "..\bin\Errors.dll"
File "..\bin\ShiftReduceParser.dll"
File "..\bin\Localization.dll"
File "..\bin\NETGenerator.dll"
File "..\bin\ParserTools.dll"
@ -28,6 +29,7 @@
File "..\bin\Mono.Cecil.dll"
File "..\bin\TeacherControlPlugin.dll"
File "..\bin\LambdaAnySynToSemConverter.dll"
File "..\bin\UniversalParserHelper.dll"
;File "libs\System.Core.dll"
File "gacutil.exe"
File "gacutil.exe.config"
@ -54,6 +56,7 @@
;dobavljaem fajly v uninst.log
${AddFile} "Compiler.dll"
${AddFile} "CompilerTools.dll"
${AddFile} "ShiftReduceParser.dll"
${AddFile} "Errors.dll"
${AddFile} "Localization.dll"
${AddFile} "NETGenerator.dll"
@ -69,6 +72,7 @@
${AddFile} "Mono.Cecil.dll"
${AddFile} "TeacherControlPlugin.dll"
${AddFile} "LambdaAnySynToSemConverter.dll"
${AddFile} "UniversalParserHelper.dll"
${AddFile} "License.txt"
${AddFile} "copyright.txt"
${AddFile} "pabcnetc.exe.config"

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AD4E1292-2537-467A-934D-E9FDA3F18D87}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>GPPG</RootNamespace>
<AssemblyName>ShiftReduceParser</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="ShiftReduceParserCode.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SyntaxTree\SyntaxTree.csproj">
<Project>{c2cac65a-b2ae-4ccc-b067-e6b8e75df73a}</Project>
<Name>SyntaxTree</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -1,4 +1,4 @@

if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" (
@ -23,6 +23,12 @@ if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.
rem Если хотите добавить другой путь к Visual Studio, можете записать его в переменную среды MSBUILD_PATH
) else if exist "%MSBUILD_PATH%" (
"%MSBUILD_PATH%" %1 %2 %3 %4
) else (
ECHO Visual Studio not found
SET ERRORLEVEL=1

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
namespace PascalABCCompiler.SyntaxTree
@ -176,7 +176,7 @@ namespace PascalABCCompiler.SyntaxTree
public enum for_cycle_type {to,downto};
public enum proc_attribute {attr_override, attr_forward, attr_virtual, attr_overload, attr_reintroduce, attr_abstract, attr_static, attr_extension, attr_none }; // attr_none íóæíî äëÿ ñâîéñòâ êîãäà virtual È override íå óêàçûâàåòñÿ
public enum proc_attribute {attr_override, attr_forward, attr_virtual, attr_overload, attr_reintroduce, attr_abstract, attr_static, attr_extension, attr_none }; // attr_none нужно для свойств когда virtual И override не указывается
public enum definition_attribute {None, Static, Const};
@ -239,7 +239,6 @@ namespace PascalABCCompiler.SyntaxTree
private int _begin_symbol_position;
private int _end_symbol_position;
private string _file_name=null;
public string FileName
{
get
@ -252,6 +251,11 @@ namespace PascalABCCompiler.SyntaxTree
}
}
/// <summary>
/// дефолтный конструктор (присваивает всем позициям единицы, что соответствует позиции начала файла)
/// </summary>
public SourceContext() : this(1, 1, 1, 1, 1, 1) { }
public SourceContext(int beg_line_num, int beg_column_num, int end_line_num, int end_column_num, int _begin_symbol_position, int _end_symbol_position)
{
_begin_position=new file_position(beg_line_num,beg_column_num);

View file

@ -208,7 +208,7 @@ namespace PascalABCCompiler.Collections
_elements_as_arr = null;
}
public void clear()
public void Clear()
{
_elements.Clear();
_elements_as_arr = null;

View file

@ -943,10 +943,10 @@ namespace PascalABCCompiler.TreeConverter
VarFinderSyntaxVisitor VFvis = new VarFinderSyntaxVisitor(syntax_body, syntax_tree_visitor.context, true);
SyntaxTree.compiler_directive dir = syntax_tree_visitor.DirectivesToNodesLinks[for_node];
//if (DirInfosTable[dir].ErrorName == "WARNING_IN_CLAUSE_PARAMETERS_REPEATED_VARS")
// syntax_tree_visitor.AddWarning(new Errors.CommonWarning(StringResources.Get(DirInfosTable[dir].ErrorName), for_node.source_context.FileName, DirInfosTable[dir].SC.begin_position.line_num, DirInfosTable[dir].SC.begin_position.column_num));
// syntax_tree_visitor.AddWarning(new Errors.CommonWarning(StringResources.Get(DirInfosTable[dir].ErrorName), for_node.source_context.file_name, DirInfosTable[dir].SC.begin_position.line_num, DirInfosTable[dir].SC.begin_position.column_num));
//else if (DirInfosTable[dir].ErrorName == "ERROR_IN_CLAUSE_PARAMETERS")
//{
// syntax_tree_visitor.AddWarning(new Errors.CommonWarning(StringResources.Get(DirInfosTable[dir].ErrorName), for_node.source_context.FileName, DirInfosTable[dir].SC.begin_position.line_num, DirInfosTable[dir].SC.begin_position.column_num));
// syntax_tree_visitor.AddWarning(new Errors.CommonWarning(StringResources.Get(DirInfosTable[dir].ErrorName), for_node.source_context.file_name, DirInfosTable[dir].SC.begin_position.line_num, DirInfosTable[dir].SC.begin_position.column_num));
//}
//else
@ -1057,10 +1057,10 @@ namespace PascalABCCompiler.TreeConverter
SyntaxTree.compiler_directive dir = syntax_tree_visitor.DirectivesToNodesLinks[syntax_stmts];
//if (DirInfosTable[dir].ErrorName == "WARNING_IN_CLAUSE_PARAMETERS_REPEATED_VARS")
// syntax_tree_visitor.AddWarning(new Errors.CommonWarning(StringResources.Get(DirInfosTable[dir].ErrorName), syntax_stmts.source_context.FileName, DirInfosTable[dir].SC.begin_position.line_num, DirInfosTable[dir].SC.begin_position.column_num));
// syntax_tree_visitor.AddWarning(new Errors.CommonWarning(StringResources.Get(DirInfosTable[dir].ErrorName), syntax_stmts.source_context.file_name, DirInfosTable[dir].SC.begin_position.line_num, DirInfosTable[dir].SC.begin_position.column_num));
//else if (DirInfosTable[dir].ErrorName == "ERROR_IN_CLAUSE_PARAMETERS")
//{
// syntax_tree_visitor.AddWarning(new Errors.CommonWarning(StringResources.Get(DirInfosTable[dir].ErrorName), syntax_stmts.source_context.FileName, DirInfosTable[dir].SC.begin_position.line_num, DirInfosTable[dir].SC.begin_position.column_num));
// syntax_tree_visitor.AddWarning(new Errors.CommonWarning(StringResources.Get(DirInfosTable[dir].ErrorName), syntax_stmts.source_context.file_name, DirInfosTable[dir].SC.begin_position.line_num, DirInfosTable[dir].SC.begin_position.column_num));
//}
//else
if (DirInfosTable[dir].ErrorName != null)

View file

@ -2191,7 +2191,7 @@ namespace PascalABCCompiler.SystemLibrary
Type arr_type = typeof(System.Array);
System.Reflection.MethodInfo resize_func_mi = arr_type.GetMethod("Resize");
_resize_func = compiled_function_node.get_compiled_method(resize_func_mi);
_resize_func.parameters.clear();
_resize_func.parameters.Clear();
common_parameter par0 = new common_parameter("Array", _object_type, SemanticTree.parameter_type.value, null,
concrete_parameter_type.cpt_none, null, null);
common_parameter par1 = new common_parameter("Length", _integer_type, SemanticTree.parameter_type.value, null,

View file

@ -391,7 +391,7 @@ namespace PascalABCCompiler.TreeConverter
res.return_value_type = visitor.convert_strong(def.return_type);
else
res.return_value_type = null;
res.parameters.clear();
res.parameters.Clear();
if (def.formal_parameters != null && def.formal_parameters.params_list.Count != 0)
{
for (int i = 0; i < def.formal_parameters.params_list.Count; i++)

View file

@ -8,7 +8,7 @@
*
***************************************************************************/
using System;
using PascalABCCompiler.TreeRealization;
using System.Collections.Generic;
namespace PascalABCCompiler.TreeConverter
@ -82,8 +82,8 @@ namespace PascalABCCompiler.TreeConverter
//stv.comp_units=UsedUnits;
//stv.visit(SyntaxUnit
//stv.interface_using_list = namespaces;
stv.using_list.clear();
stv.interface_using_list.clear();
stv.using_list.Clear();
stv.interface_using_list.Clear();
stv.using_list.AddRange(namespaces);
stv.current_document = new TreeRealization.document(SyntaxUnit.file_name);
stv.ErrorsList = ErrorsList;
@ -133,7 +133,7 @@ namespace PascalABCCompiler.TreeConverter
stv.bad_nodes_in_syntax_tree = bad_nodes;
stv.referenced_units = UsedUnits;
stv.using_list.clear();
stv.using_list.Clear();
stv.using_list.AddRange(interface_namespaces);
stv.interface_using_list.AddRange(interface_namespaces);
stv.using_list.AddRange(imlementation_namespaces);
@ -153,8 +153,8 @@ namespace PascalABCCompiler.TreeConverter
{
throw new PascalABCCompiler.TreeConverter.CompilerInternalError("Program has not implementation part");
}
//TODO: Переделать, чтобы Сашин код работал с common_unit_node.
stv.compiled_unit=(PascalABCCompiler.TreeRealization.common_unit_node)SemanticUnit;
stv.compiled_unit = SemanticUnit;
stv.current_document = new TreeRealization.document(SyntaxUnit.file_name);
foreach (SyntaxTree.compiler_directive cd in umod.compiler_directives)
@ -165,6 +165,7 @@ namespace PascalABCCompiler.TreeConverter
//stv.visit(SyntaxUnit);
//return stv.compiled_unit;
}
public void Reset()
{
stv.reset();

View file

@ -576,7 +576,7 @@ namespace PascalABCCompiler.TreeConverter
_compiled_unit = null;
_referenced_units = null;
current_document = null;
using_list.clear();
using_list.Clear();
//_referenced_units.clear();
ret.reset();
motivation_keeper.reset();
@ -1481,7 +1481,7 @@ namespace PascalABCCompiler.TreeConverter
{
if (cmn.cont_type.IsAbstract)
AddError(loc, "ABSTRACT_CONSTRUCTOR_{0}_CALL", cmn.cont_type.name);
ret.clear();
ret.Clear();
ret.AddElement(new common_constructor_call(cmn, loc));
return ret;
}
@ -8869,7 +8869,7 @@ namespace PascalABCCompiler.TreeConverter
check_on_loop_variable(en);
//if (en.type == null)
//throw new CanNotRead(en.location);
exl.clear();
exl.Clear();
if (read_from_file)
exl.AddElement(file);
if (read_from_typed_file)
@ -8983,7 +8983,7 @@ namespace PascalABCCompiler.TreeConverter
{
if (last_call != null && convertion_data_and_alghoritms.statement_list_stack.size > 0)
convertion_data_and_alghoritms.statement_list_stack.top().statements.AddElement(last_call);
exl.clear();
exl.Clear();
if (read_from_file)
exl.AddElement(file);
@ -11796,7 +11796,7 @@ namespace PascalABCCompiler.TreeConverter
parameter_list temp_params = new parameter_list();
foreach (SyntaxTree.typed_parameters tpars in syn_parametres.params_list)
{
temp_params.clear();
temp_params.Clear();
SemanticTree.parameter_type pt = SemanticTree.parameter_type.value;
concrete_parameter_type cpt = concrete_parameter_type.cpt_none;
switch (tpars.param_kind)
@ -19053,7 +19053,7 @@ namespace PascalABCCompiler.TreeConverter
{
current_using_list.AddElement(un);
}
using_list.clear();
using_list.Clear();
foreach (using_namespace un in tc.using_list)
{
using_list.AddElement(un);
@ -19149,7 +19149,7 @@ namespace PascalABCCompiler.TreeConverter
context.converted_namespace = pdi.nspace;
using_namespace_list ulist =
(pdi.nspace == tc.cnn) ? tc.using_list : tc.using_list2;
using_list.clear();
using_list.Clear();
foreach (using_namespace un in ulist)
{
using_list.AddElement(un);
@ -19198,7 +19198,7 @@ namespace PascalABCCompiler.TreeConverter
type_section_converting = current_type_section_converting;
context.member_decls = current_member_decls;
context.var_defs = current_var_defs;
using_list.clear();
using_list.Clear();
foreach (using_namespace un in current_using_list)
{
using_list.AddElement(un);

View file

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Общие сведения об этой сборке предоставляются следующим набором
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
// связанные со сборкой.
[assembly: AssemblyTitle("UniversalParserHelper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UniversalParserHelper")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
[assembly: ComVisible(false)]
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
[assembly: Guid("e862a9ef-836b-414b-aac4-9d207cabdc82")]
// Сведения о версии сборки состоят из указанных ниже четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Редакция
//
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -0,0 +1,385 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using QUT.Gppg;
using PascalABCCompiler.SyntaxTree;
using PascalABCCompiler.Errors;
namespace UniversalParserHelper
{
public static class StringResources
{
private static string prefix = "PASCALABCPARSER_";
public static string Get(string Id)
{
string ret = PascalABCCompiler.StringResources.Get(prefix + Id);
if (ret == prefix + Id)
return Id;
else
return ret;
}
}
public abstract class UniversalParserHelper
{
private const int max_char_const = 0xFFFF;
// SSM: Errors инициализируется в другом месте - сюда только передается!
public List<Error> errors;
public List<CompilerWarning> warnings;
public System.Collections.Stack NodesStack; // SSM: для каких-то вспомогательных целей в двух правилах
public bool build_tree_for_formatter = false;
public bool build_tree_for_format_strings = false;
public string CurrentFileName;
public List<compiler_directive> compilerDirectives;
public List<var_def_statement> pascalABC_var_statements;
public List<type_declaration> pascalABC_type_declarations;
public UniversalParserHelper()
{
NodesStack = new System.Collections.Stack();
pascalABC_var_statements = new List<var_def_statement>();
pascalABC_type_declarations = new List<type_declaration>();
}
public string directive_parameter(string s)
{
var ind = s.IndexOf(" ");
if (ind < 0)
return "";
else
{
s = s.Substring(ind + 1);
s = s.TrimEnd('}');
return s;
}
}
public ident create_directive_name(string text, SourceContext sc)
{
ident dn = new ident(new string(text.ToCharArray(1, text.Length - 1)));
dn.source_context = sc;
return dn;
}
public string RemoveThousandsDelimiter(string s, SourceContext sc)
{
if (s.EndsWith("_") || s.Contains("__"))
{
var errstr = ParserErrorsStringResources.Get("BAD_FORMED_NUM_CONST");
errors.Add(new SyntaxError(errstr, CurrentFileName, sc, null));
}
return s.Replace("_", "");
}
private const_node create_int_const(string text, SourceContext sc, System.Globalization.NumberStyles NumberStyles)
{
//таблица целых констант на уровне синтаксиса
// не может быть - 0 +
// 32--------16----8----|----8----16--------32----------------64(bits)
// [ int64 )[ int32 ]( int64 ]( uint64 ]
text = RemoveThousandsDelimiter(text, sc);
if (NumberStyles == System.Globalization.NumberStyles.HexNumber)
text = text.Substring(1);
const_node cn = new int32_const();
if (text.Length < 8)
(cn as int32_const).val = Int32.Parse(text, NumberStyles);
else
{
try
{
UInt64 uint64 = UInt64.Parse(text, NumberStyles);
if (uint64 <= Int32.MaxValue)
(cn as int32_const).val = (Int32)uint64;
else
if (uint64 <= Int64.MaxValue)
cn = new int64_const((Int64)uint64);
else
cn = new uint64_const(uint64);
}
catch (Exception)
{
if (NumberStyles == System.Globalization.NumberStyles.HexNumber)
errors.Add(new BadHex(CurrentFileName, sc, null));
else
errors.Add(new BadInt(CurrentFileName, sc, null));
}
}
cn.source_context = sc;
return cn;
}
public const_node create_int_const(string text, SourceContext sc)
{
return create_int_const(text, sc, System.Globalization.NumberStyles.Integer);
}
public const_node create_double_const(string text, SourceContext sc)
{
const_node cn = null;
try
{
System.Globalization.NumberFormatInfo sgnfi = new System.Globalization.NumberFormatInfo();
sgnfi.NumberDecimalSeparator = ".";
text = RemoveThousandsDelimiter(text, sc);
double val = double.Parse(text, sgnfi);
cn = new double_const(val);
cn.source_context = sc;
}
catch (Exception)
{
errors.Add(new BadFloat(CurrentFileName, sc, null));
}
return cn;
}
public const_node create_bigint_const(string text, SourceContext sc)
{
text = RemoveThousandsDelimiter(text, sc);
var txt = text.Substring(0, text.Length - 2);
var cn = new bigint_const();
try
{
cn.val = System.UInt64.Parse(txt);
}
catch (Exception)
{
errors.Add(new BadInt(CurrentFileName, sc, null));
}
cn.source_context = sc;
return cn;
}
public ident create_ident(string text, SourceContext sc)
{
if (text[0] == '&')
text = text.Substring(1);
ident id = new ident(text);
id.source_context = sc;
return id;
}
public string ReplaceSpecialSymbols(string text)
{
text = text.Replace("''", "'");
return text;
}
public char_const create_char_const(string text, SourceContext sc)
{
string char_text = new string(text.ToCharArray(1, text.Length - 2));
char_text = ReplaceSpecialSymbols(char_text);
char_const ct = new char_const();
ct.source_context = sc;
if (char_text.Length == 1)
{
ct.cconst = char_text[0];
return ct;
}
return null;
}
public sharp_char_const create_sharp_char_const(string text, SourceContext sc)
{
string int_text = new string(text.ToCharArray(1, text.Length - 1));
sharp_char_const scc = null;
int val = 0;
if (int.TryParse(int_text, out val))
{
if (val > max_char_const)
{
scc = new sharp_char_const(0);
errors.Add(new TooBigCharNumberInSharpCharConstant(CurrentFileName, sc, scc));
}
else
scc = new sharp_char_const(val);
scc.source_context = sc;
}
else
{
errors.Add(new TooBigCharNumberInSharpCharConstant(CurrentFileName, sc, scc));
}
return scc;
}
public literal create_string_const(string text, SourceContext sc)
{
literal lt;
if (text.Length == 3 && text[0] == '\'' && text[2] == '\'')
{
lt = new char_const(text[1]);
lt.source_context = sc;
return lt;
}
text = ReplaceSpecialSymbols(text.Substring(1, text.Length - 2));
lt = new string_const(text);
lt.source_context = sc;
return lt;
}
public literal create_format_string_const(string text, SourceContext sc)
{
literal lt;
text = ReplaceSpecialSymbols(text.Substring(2, text.Length - 3));
lt = new string_const(text);
(lt as string_const).IsInterpolated = true;
lt.source_context = sc;
return lt;
}
public void AddError(string message, LexLocation loc)
{
errors.Add(new SyntaxError(message, CurrentFileName, loc, null));
}
public string CreateErrorString(string yytext, LexLocation yyloc, params object[] args)
{
string prefix = "";
if (yytext != "")
prefix = StringResources.Get("FOUND{0}");
else
prefix = StringResources.Get("FOUNDEOF");
if (this.build_tree_for_format_strings && prefix == StringResources.Get("FOUNDEOF"))
{
yytext = "}";
prefix = StringResources.Get("FOUND{0}");
}
// Преобразовали в список строк - хорошо
string expected = String.Join(", ", args.Skip(1).Select(x => x.ToString()));
var ExpectedString = StringResources.Get("EXPECTED{1}");
// string w = string.Join(" или ", tokens.Select(s => ConvertToHumanName((string)s)));
return string.Format(prefix + ExpectedString, "'" + yytext + "'", expected);
}
/* public string CreateErrorString(string yytext, LexLocation yyloc, params object[] args)
{
string expected = String.Join(", ", args.Skip(1).Select(x => x.ToString()));
string err = $"PARSER ERROR \"{yytext}\" AT LINE #{yyloc.StartLine}: EXPECTED {expected}, FOUND {args[0]}";
return err;
}*/
public List<object> ident_list11(object lr1, object lr3)
{
List<object> ar = (List<object>)lr3;
ar.Insert(0, lr1);
return ar;
}
public List<object> ident_list12(object lr0)
{
List<object> ar = new List<object>();
ar.Add(lr0);
return ar;
}
public List<object> ident_list21(object lr0, object lr2)
{
List<object> ar = (List<object>)lr0;
ar.Add(lr2);
return ar;
}
public List<object> ident_list13(object lr1, object lr3, object lr5)
{
List<object> ar = (List<object>)lr5;
//named_type_reference n_t_r = (named_type_reference)lr3;
var_def_statement vds = new var_def_statement();
vds.vars = new ident_list();
vds.vars.idents.Add((ident)lr1);
vds.vars_type = (type_definition)lr3;//n_t_r;
ar.Insert(0, vds);
return ar;
}
public List<object> ident_list14(object lr1, object lr3)
{
List<object> ar = new List<object>();
//named_type_reference n_t_r = (named_type_reference)lr3;
var_def_statement vds = new var_def_statement();
vds.vars = new ident_list();
vds.vars.idents.Add((ident)lr1);
vds.vars_type = (type_definition)lr3;
ar.Add(vds);
return ar;
}
public void create_source_context(object to, object left, object right)
{
if (to != null)
((syntax_tree_node)to).source_context = get_source_context(left, right);
}
public SourceContext get_source_context(object left, object right)
{
//debug
/*if (left == null && right!=null)
{
Console.WriteLine("\n\rerror: left is null(create_source_context)!\n\r");
Console.WriteLine(((syntax_tree_node)right).source_context.ToString());
}
if (right == null && left!=null)
{
Console.WriteLine("\n\rerror: right is null(create_source_context)!\n\r");
Console.WriteLine(((syntax_tree_node)left).source_context.ToString());
}
if (((syntax_tree_node)left).source_context == null)
{
Console.WriteLine("\n\rerror: source_context is null!(left)\n\r");
return null;
}
if (((syntax_tree_node)right).source_context == null)
{
Console.WriteLine("\n\rerror: source_context is null!(right)\n\r");
return null;
}
*/
if ((left == null) || (right == null) || (((syntax_tree_node)left).source_context == null) || (((syntax_tree_node)right).source_context == null))
return null;
return new SourceContext(((syntax_tree_node)left).source_context, ((syntax_tree_node)right).source_context);
}
public void create_source_context_left(object to, object left)
{
file_position fp = ((syntax_tree_node)left).source_context.begin_position;
((syntax_tree_node)to).source_context = new SourceContext(fp.line_num, fp.column_num, fp.line_num, fp.column_num, 0, 0);
}
public void create_source_context_right(object to, object right)
{
file_position fp = ((syntax_tree_node)right).source_context.end_position;
((syntax_tree_node)to).source_context = new SourceContext(fp.line_num, fp.column_num, fp.line_num, fp.column_num, 0, 0);
}
public object sc_not_null(object o1, object o2)
{
if (o1 != null)
if (((syntax_tree_node)o1).source_context != null) return o1;
return o2;
}
public object sc_not_null(object o1, object o2, object o3)
{
if (o1 != null)
if (((syntax_tree_node)o1).source_context != null) return o1;
if (o2 != null)
if (((syntax_tree_node)o2).source_context != null) return o2;
return o3;
}
public object sc_not_null(params object[] arr)
{
foreach (object o in arr)
if (o != null)
if (((syntax_tree_node)o).source_context != null) return o;
return null;
}
public void assign_source_context(object to, object from)
{
//debug
//if (((tree_node)from).source_context==null) Console.WriteLine("\n\rerror: from sc is null(assign_source_context)!\n\r");
if (to != null && from != null)
((syntax_tree_node)to).source_context = ((syntax_tree_node)from).source_context;
}
}
}

View file

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E862A9EF-836B-414B-AAC4-9D207CABDC82}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UniversalParserHelper</RootNamespace>
<AssemblyName>UniversalParserHelper</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="UniversalParserHelper.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Errors\Errors.csproj">
<Project>{44a01f9e-dce7-470c-aae5-c3de0ccbee3b}</Project>
<Name>Errors</Name>
</ProjectReference>
<ProjectReference Include="..\Localization\Localization.csproj">
<Project>{2de2842f-0912-4251-bc0f-480854c44a13}</Project>
<Name>Localization</Name>
</ProjectReference>
<ProjectReference Include="..\ParserTools\ParserTools.csproj">
<Project>{af2efd7b-69dd-4b43-af65-b59b29349c23}</Project>
<Name>ParserTools</Name>
</ProjectReference>
<ProjectReference Include="..\ShiftReduceParser\ShiftReduceParser.csproj">
<Project>{ad4e1292-2537-467a-934d-e9fda3f18d87}</Project>
<Name>ShiftReduceParser</Name>
</ProjectReference>
<ProjectReference Include="..\SyntaxTree\SyntaxTree.csproj">
<Project>{c2cac65a-b2ae-4ccc-b067-e6b8e75df73a}</Project>
<Name>SyntaxTree</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

View file

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using ICSharpCode.TextEditor.Document;
using ICSharpCode.TextEditor;
using System.Text.RegularExpressions;
using System.Drawing.Imaging;
namespace VisualPascalABC
{
@ -250,7 +251,7 @@ namespace VisualPascalABC
{
string cur, next, prev;
GetCurNextLines(out cur, out next, out prev);
if (ta.Caret.Column >= cur.Length)
if (ta.Caret.Column >= cur.Length && prev != null)
{
var prevTrimEnd = prev.TrimEnd();
// если prev заканчивается на then, а cur не начинается с begin, то отступ назад

View file

@ -11,7 +11,7 @@ namespace ICSharpCode.TextEditor.Document
/// </summary>
/* public class TestFoldingStrategy : IFoldingStrategy
{
public List<FoldMarker> GenerateFoldMarkers(IDocument document, string fileName, object parseInformation)
public List<FoldMarker> GenerateFoldMarkers(IDocument document, string file_name, object parseInformation)
{
List<FoldMarker> l = new List<FoldMarker>();
Stack<int> offsetStack = new Stack<int>();

View file

@ -23,7 +23,7 @@ namespace VisualPascalABC
{
SourceLocation sl = null;
/*if (lines_to_locations.TryGetValue(LineNum, out sl))
if (sl.FileName == FileName)
if (sl.file_name == file_name)
{
sl.BeginPosition.Column = sl.EndPosition.Column = ColumnNum;
locations.Remove(sl);

View file

@ -243,7 +243,7 @@ namespace VisualPascalABC
public void SendText(string FileName, string Text)
{
//messageServer.SendText(FileName, Text);
//messageServer.SendText(file_name, Text);
}
/*private void MessageQueueReceive_Callback(IAsyncResult ar)

View file

@ -250,7 +250,7 @@ namespace VisualPascalABC
return ed.Document.TextContent;
if (!File.Exists(FileName))
return null;
/*TextReader tr = new StreamReader(FileName, System.Text.Encoding.GetEncoding(1251));
/*TextReader tr = new StreamReader(file_name, System.Text.Encoding.GetEncoding(1251));
string Text = tr.ReadToEnd();
tr.Close();*/
string Text = PascalABCCompiler.FileReader.ReadFileContent(FileName, null);

View file

@ -104,16 +104,16 @@ namespace VisualPascalABC.Avalon
public void UpdateFolding()
{
CodeCompletionParserController.open_files[this.FileName] = true;
CodeCompletionParserController.open_files[this.file_name] = true;
}
public void UpdateFolding(object parseInfo, string fileName)
public void UpdateFolding(object parseInfo, string file_name)
{
try
{
if (EnableFolding && fileName == this.FileName)
if (EnableFolding && file_name == this.file_name)
{
foldingManager.UpdateFoldings(fileName, parseInfo);
foldingManager.UpdateFoldings(file_name, parseInfo);
refresh_Folding();
}
}

View file

@ -514,7 +514,7 @@ namespace VisualPascalABC
List<PascalABCCompiler.Errors.CompilerWarning> Warnings = new List<PascalABCCompiler.Errors.CompilerWarning>();
//PascalABCCompiler.SyntaxTree.syntax_tree_node sn =
// MainForm.VisualEnvironmentCompiler.Compiler.ParsersController.Compile(
// FileName, TextEditor.Text, null, Errors, PascalABCCompiler.Parsers.ParseMode.Normal);
// file_name, TextEditor.Text, null, Errors, PascalABCCompiler.Parsers.ParseMode.Normal);
PascalABCCompiler.SyntaxTree.compilation_unit sn =
CodeCompletion.CodeCompletionController.ParsersController.GetCompilationUnit(
VisualPABCSingleton.MainForm._currentCodeFileDocument.FileName,

View file

@ -134,7 +134,7 @@ namespace VisualPascalABC
MainForm.ExecuteErrorPos(er.SourceLocation, 2);
else // ImageIndex==2 - ошибка выполнения
MainForm.ExecuteErrorPos(er.SourceLocation, 1);
//OpenFile(er.SourceLocation.FileName);
//OpenFile(er.SourceLocation.file_name);
//(tabControl1.SelectedTab.ag as CodeFileDocumentControl).TextEditor.CaretPosition(er.SourceLocation.BeginPosition.Line,er.SourceLocation.BeginPosition.Column);
}
}

View file

@ -612,7 +612,7 @@ namespace VisualPascalABC
case VisualEnvironmentCompilerAction.OpenFile:
return WorkbenchServiceFactory.FileService.OpenFile((string)obj, null);
case VisualEnvironmentCompilerAction.GetDirectory:
string s=VisualEnvironmentCompiler.Compiler.CompilerOptions.StandartDirectories[(string)obj] as string;
string s=VisualEnvironmentCompiler.Compiler.CompilerOptions.StandardDirectories[(string)obj] as string;
if (s != null)
return s;
return WorkbenchStorage.StandartDirectories[(string)obj] as string;

View file

@ -65,9 +65,9 @@ namespace ICSharpCode.FormsDesigner.Services
}
/* We don't need to debug controls inside the forms designer
files = Directory.GetFiles(Path.GetTempPath(), "*.pdb");
foreach (string fileName in files) {
foreach (string file_name in files) {
try {
File.Delete(fileName);
File.Delete(file_name);
} catch {}
}*/
}
@ -268,7 +268,7 @@ namespace ICSharpCode.FormsDesigner.Services
File.Copy(fileName, tempPath);
/* We don't need to debug controls inside the forms designer
string pdbpath = Path.GetDirectoryName(fileName) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(fileName) + ".pdb";
string pdbpath = Path.GetDirectoryName(file_name) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(file_name) + ".pdb";
if (File.Exists(pdbpath)) {
string newpdbpath = Path.GetTempPath() + Path.DirectorySeparatorChar + Path.GetFileName(pdbpath);
try {

View file

@ -600,7 +600,7 @@ namespace VisualPascalABC
List<PascalABCCompiler.Errors.Error> Errors = new List<PascalABCCompiler.Errors.Error>();
//PascalABCCompiler.SyntaxTree.syntax_tree_node sn =
// MainForm.VisualEnvironmentCompiler.Compiler.ParsersController.Compile(
// FileName, TextEditor.Text, null, Errors, PascalABCCompiler.Parsers.ParseMode.Normal);
// file_name, TextEditor.Text, null, Errors, PascalABCCompiler.Parsers.ParseMode.Normal);
string text = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.SourceFilesProvider(VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName, PascalABCCompiler.SourceFileOperation.GetText) as string;
PascalABCCompiler.SyntaxTree.compilation_unit cu =
CodeCompletion.CodeCompletionController.ParsersController.GetCompilationUnitForFormatter(

View file

@ -178,8 +178,9 @@ namespace VisualPascalABC
CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[editor.FileName];
if (dconv != null)
{
// TODO: check endl error | added null check EVA
CodeCompletion.SymScope ss = dconv.FindScopeByLocation(editor.ActiveTextAreaControl.TextArea.Caret.Line + 1, editor.ActiveTextAreaControl.TextArea.Caret.Column + 1);
ss.IncreaseEndLine();
ss?.IncreaseEndLine();
}
}
catch

View file

@ -172,7 +172,7 @@ namespace VisualPascalABC
open_files[FileName] = false;
if (dc.is_compiled)
{
//CodeCompletion.CodeCompletionController.comp_modules.Remove(FileName);
//CodeCompletion.CodeCompletionController.comp_modules.Remove(file_name);
if (tmp != null && tmp.visitor.entry_scope != null)
{
tmp.visitor.entry_scope.Clear();

View file

@ -236,7 +236,7 @@ namespace VisualPascalABC
if (dconv == null) return new List<SymbolsViewerSymbol>();
List<SymbolsViewerSymbol> lst = InternalFindReferences(fileName, e, line, column, for_refact);
//if (lst != null && expr != null && for_refact)
//lst.Insert(0,new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(fileName,line+1,column,line+1,column+expr.Length),ImagesProvider.IconNumberGotoText));
//lst.Insert(0,new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(file_name,line+1,column,line+1,column+expr.Length),ImagesProvider.IconNumberGotoText));
return lst;
}
@ -520,7 +520,7 @@ namespace VisualPascalABC
foreach (SymInfo mi in mis)
{
if (mi.not_include) continue;
if (mi == null || mi.not_include) continue;
if (cache.Contains(mi.name + mi.kind))
continue;
@ -572,7 +572,7 @@ namespace VisualPascalABC
controller = new CodeCompletion.CodeCompletionController();
int off = textArea.Caret.Offset;
string text = textArea.Document.TextContent.Substring(0, textArea.Caret.Offset);
//controller.Compile(fileName, text /*+ ")))));end."*/);
//controller.Compile(file_name, text /*+ ")))));end."*/);
FileName = fileName; Text = text;
ICompletionData[] data = GetCompletionData(off, text, textArea.Caret.Line, textArea.Caret.Column, charTyped, keyw);
CodeCompletion.AssemblyDocCache.CompleteDocumentation();
@ -626,7 +626,7 @@ namespace VisualPascalABC
controller = new CodeCompletion.CodeCompletionController();
int off = textArea.Caret.Offset;
string text = textArea.Document.TextContent.Substring(0, textArea.Caret.Offset);
//controller.Compile(fileName, text /*+ ")))));end."*/);
//controller.Compile(file_name, text /*+ ")))));end."*/);
FileName = fileName; Text = text;
ICompletionData[] data = GetCompletionDataByFirst(off, text, textArea.Caret.Line, textArea.Caret.Column, charTyped, keyw);
CodeCompletion.AssemblyDocCache.CompleteDocumentation();

View file

@ -317,7 +317,7 @@ namespace VisualPascalABC
{
// Still needed ?
/*if (currentCompilationUnit == null) {
currentCompilationUnit = (ICompilationUnit)ParserService.GetParseInformation(Path.GetFullPath(textAreaControl.FileName)).MostRecentCompilationUnit;
currentCompilationUnit = (ICompilationUnit)ParserService.GetParseInformation(Path.GetFullPath(textAreaControl.file_name)).MostRecentCompilationUnit;
}*/
autoselect = false;
@ -803,7 +803,7 @@ namespace VisualPascalABC
{
//textAreaControl.ActiveTextAreaControl.Caret.Position = new ICSharpCode.TextEditor.TextLocation(item.Column, item.Line);
//textAreaControl.ActiveTextAreaControl.TextArea.Focus();
//VisualPABCSingleton.MainForm.ExecuteSourceLocationAction(new PascalABCCompiler.SourceLocation(textAreaControl.FileName,item.Line+1,item.Column,
//VisualPABCSingleton.MainForm.ExecuteSourceLocationAction(new PascalABCCompiler.SourceLocation(textAreaControl.file_name,item.Line+1,item.Column,
// item.EndLine+1,item.Column),VisualPascalABCPlugins.SourceLocationAction.NavigationGoto);
VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.ExecuteSourceLocationAction(
new PascalABCCompiler.SourceLocation(textAreaControl.FileName, item.Line + 1, item.Column + 1, item.Line + 1, item.Column + 1), VisualPascalABCPlugins.SourceLocationAction.GotoBeg);

View file

@ -156,7 +156,7 @@ namespace VisualPascalABC
{
ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider;
if (tecp != null)
SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
SetPosition(tecp.TextEditorControl.file_name, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
else
Remove();
}*/
@ -269,7 +269,7 @@ namespace VisualPascalABC
static int endLine;
static int endColumn;
//public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerEndLine)
//public static void SetPosition(string file_name, IDocument document, int makerStartLine, int makerEndLine)
public static void SetPosition(TextEditorControl ctrl, int makerStartLine)
{
try
@ -342,7 +342,7 @@ namespace VisualPascalABC
static int endLine;
static int endColumn;
//public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerEndLine)
//public static void SetPosition(string file_name, IDocument document, int makerStartLine, int makerEndLine)
public static void SetPosition(TextEditorControl ctrl, int makerStartLine)
{
try
@ -426,7 +426,7 @@ namespace VisualPascalABC
{
ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider;
if (tecp != null)
SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
SetPosition(tecp.TextEditorControl.file_name, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
else
Remove();
}*/

View file

@ -342,7 +342,7 @@ namespace VisualPascalABC
}
/// <summary>
/// Добавить Breakpoint в файл fileName строку line
/// Добавить Breakpoint в файл file_name строку line
/// </summary>
public Breakpoint AddBreakPoint(string fileName, int line, bool commonBreakpoint)
{
@ -367,7 +367,7 @@ namespace VisualPascalABC
}
/// <summary>
/// Получить список Breakpointov в файле fileName
/// Получить список Breakpointov в файле file_name
/// </summary>
public List<Breakpoint> GetBreakpointsInFile(string fileName)
{
@ -412,7 +412,7 @@ namespace VisualPascalABC
dbg.ProcessExited += debugProcessExit;
dbg.BreakpointHit += debugBreakpointHit;
//if (brPoint != null) dbg.RemoveBreakpoint(brPoint);
this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(fileName) + ".pas";
this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(file_name) + ".pas";
this.FullFileName = Path.Combine(Path.GetDirectoryName(fileName), this.FileName);
this.ExeFileName = fileName;
this.PrevFullFileName = FullFileName;
@ -460,7 +460,7 @@ namespace VisualPascalABC
sourceFileName = workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileName;
else
sourceFileName = ProjectFactory.Instance.CurrentProject.MainFile;
this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(fileName) + ".pas";
this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(file_name) + ".pas";
this.FullFileName = Path.Combine(Path.GetDirectoryName(fileName), this.FileName);
this.ExeFileName = fileName;
CurrentLine = 0;
@ -469,7 +469,7 @@ namespace VisualPascalABC
AssemblyHelper.LoadAssembly(fileName);
dbg.ProcessStarted += debugProcessStarted;
dbg.ProcessExited += debugProcessExit;
//brPoint = dbg.AddBreakpoint(FileName, frm.VisualEnvironmentCompiler.Compiler.BeginOffset);
//brPoint = dbg.AddBreakpoint(file_name, frm.VisualEnvironmentCompiler.Compiler.BeginOffset);
try
{
debuggedProcess = dbg.DebugActiveProcess(handle, fileName);
@ -1762,7 +1762,7 @@ namespace VisualPascalABC
{
try
{
//cur_brpt = dbg.AddBreakpoint(new SourcecodeSegment((frm.CurrentTabPage.ag as CodeFileDocumentControl).FileName,(frm.CurrentTabPage.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Line + 1,(frm.CurrentTabPage.Tag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Column + 1,
//cur_brpt = dbg.AddBreakpoint(new SourcecodeSegment((frm.CurrentTabPage.ag as CodeFileDocumentControl).file_name,(frm.CurrentTabPage.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Line + 1,(frm.CurrentTabPage.Tag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Column + 1,
// (frm.CurrentTabPage.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Column+100), true);
workbench.WidgetController.SetStartDebugDisabled();
currentBreakpoint = dbg.AddBreakpoint(WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.FileName, WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Caret.Line + 1);

View file

@ -224,7 +224,7 @@ namespace VisualPascalABC
catch
{
}
this.tbAppIcon.Text = Path.GetFileName(openFileDialog1.FileName);//PascalABCCompiler.Tools.RelativePathTo(ProjectFactory.Instance.CurrentProject.ProjectDirectory, openFileDialog1.FileName);
this.tbAppIcon.Text = Path.GetFileName(openFileDialog1.FileName);//PascalABCCompiler.Tools.RelativePathTo(ProjectFactory.Instance.CurrentProject.ProjectDirectory, openFileDialog1.file_name);
}
}

View file

@ -19,7 +19,7 @@ namespace VisualPascalABC.Properties {
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.1
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
@ -12,7 +12,7 @@ namespace VisualPascalABC.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

View file

@ -425,6 +425,7 @@
<Compile Include="Workbench\WorkbenchServiceFactory.cs" />
<EmbeddedResource Include="ABCHealth.resx">
<DependentUpon>ABCHealth.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="AboutBox.resx">
<SubType>Designer</SubType>

View file

@ -71,13 +71,13 @@ namespace VisualPascalABC
if (Path.GetDirectoryName(CompilerOptions1.SourceFileName).ToLower() == ((string)WorkbenchStorage.StandartDirectories[Constants.LibSourceDirectoryIdent]).ToLower())
Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = false;
if (RuntimeServicesModule != null)
CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandardModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
string ofn = Workbench.VisualEnvironmentCompiler.Compile(CompilerOptions1);
Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = savePCU;
if (RuntimeServicesModule != null)
CompilerOptions1.RemoveStandartModuleAtIndex(CompilerOptions1.StandartModules.Count - 1);
CompilerOptions1.RemoveStandardModuleAtIndex(CompilerOptions1.StandardModules.Count - 1);
if (Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count != 0 || Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0)
{
@ -111,9 +111,9 @@ namespace VisualPascalABC
CompilerOptions1.RunWithEnvironment = RunWithEnvironment;
//string runtimeModuleFileName = CompilerOptions1.SearchDirectory + "\\" + RuntimeServicesModule;
//if (RuntimeServicesModule!=null && File.Exists(runtimeModuleFileName))
// CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
// CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
if (RuntimeServicesModule != null)
CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandardModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
ErrorsList.Clear();
@ -127,7 +127,7 @@ namespace VisualPascalABC
Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = savePCU;
if (RuntimeServicesModule != null)
CompilerOptions1.RemoveStandartModuleAtIndex(CompilerOptions1.StandartModules.Count - 1);
CompilerOptions1.RemoveStandardModuleAtIndex(CompilerOptions1.StandardModules.Count - 1);
if (Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count != 0 || Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0)
{
@ -159,16 +159,16 @@ namespace VisualPascalABC
CompilerOptions1.RunWithEnvironment = RunWithEnvironment;
//string runtimeModuleFileName = CompilerOptions1.SearchDirectory + "\\" + RuntimeServicesModule;
//if (RuntimeServicesModule!=null && File.Exists(runtimeModuleFileName))
// CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
// CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
if (__RuntimeServicesModule != null)
CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandardModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
ErrorsList.Clear();
//CompilerOptions1.SavePCUInThreadPull = true;
__savePCU = Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate;
//if (Path.GetDirectoryName(FileName).ToLower() == ((string)StandartDirectories[Constants.LibSourceDirectoryIdent]).ToLower())
//if (Path.GetDirectoryName(file_name).ToLower() == ((string)StandartDirectories[Constants.LibSourceDirectoryIdent]).ToLower())
// VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = false;
Workbench.VisualEnvironmentCompiler.Compiler.OnChangeCompilerState += CompilationOnChangeCompilerState;
@ -195,9 +195,9 @@ namespace VisualPascalABC
CompilerOptions1.RunWithEnvironment = RunWithEnvironment;
//string runtimeModuleFileName = CompilerOptions1.SearchDirectory + "\\" + RuntimeServicesModule;
//if (RuntimeServicesModule!=null && File.Exists(runtimeModuleFileName))
// CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
// CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
if (__RuntimeServicesModule != null)
CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandardModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
ErrorsList.Clear();
@ -267,7 +267,7 @@ namespace VisualPascalABC
Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = __savePCU;
if (__RuntimeServicesModule != null)
CompilerOptions1.RemoveStandartModuleAtIndex(CompilerOptions1.StandartModules.Count - 1);
CompilerOptions1.RemoveStandardModuleAtIndex(CompilerOptions1.StandardModules.Count - 1);
if (Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count != 0 || Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0)
{

View file

@ -40,7 +40,7 @@ namespace VisualPascalABC
private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
{
//ReplaceLastFile(CurrentSourceFileName, saveFileDialog1.FileName);
//ReplaceLastFile(CurrentSourceFileName, saveFileDialog1.file_name);
string fn = Tools.FileNameToLower(saveFileDialog1.FileName);
if (OpenDocuments.ContainsKey(fn) && OpenDocuments[fn] != CurrentCodeFileDocument)
{

View file

@ -150,7 +150,7 @@ namespace VisualPascalABC
visualStates.FileOpened = true;//?????
if (!IsNewFile && !File.Exists(FileName))
{
//MessageBox.Show(string.Format(PascalABCCompiler.StringResources.Get("!FILE_NOT_FOUND{0}"), FileName), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
//MessageBox.Show(string.Format(PascalABCCompiler.StringResources.Get("!FILE_NOT_FOUND{0}"), file_name), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
bool exists = false;
foreach (string s in search_debug_paths)
{
@ -189,7 +189,7 @@ namespace VisualPascalABC
else
if (!IsNewFile)
{
//CheckErrorListAndClear((tabControl1.TabPages[TabIndex].ag as CodeFileDocumentControl).FileName);
//CheckErrorListAndClear((tabControl1.TabPages[TabIndex].ag as CodeFileDocumentControl).file_name);
CurrentCodeFileDocument.FileName = FileName;
if (!ProjectFactory.Instance.ProjectLoaded)
SetTabPageText(CurrentCodeFileDocument);

View file

@ -460,8 +460,8 @@ namespace VisualPascalABC
clicked_stop_debug_in_menu = false;
this.mDEBUGENDToolStripMenuItem.Enabled = false;
//Data fileInfo = debuggedPage.ag as CodeFileDocumentControl;
//debuggedPage.Text = Path.GetFileName(fileInfo.FileName);
//debuggedPage.ToolTipText = fileInfo.FileName;
//debuggedPage.Text = Path.GetFileName(fileInfo.file_name);
//debuggedPage.ToolTipText = fileInfo.file_name;
SetTabPageText(debuggedPage);
ChangeDebugButtons(false);
SaveDebugContext();

View file

@ -252,7 +252,7 @@ namespace VisualPascalABC
SetTabPageText(edit);
edit.SetHighlightingStrategyForFile(FileName);
OpenDocuments.Add(Tools.FileNameToLower(FileName), edit);
//this.codeCompletionParserController.SetAsChanged(FileName);
//this.codeCompletionParserController.SetAsChanged(file_name);
//ivan
AddBreakPointHandler(edit, FileName);
var RunService = WorkbenchServiceFactory.RunService;
@ -473,7 +473,7 @@ namespace VisualPascalABC
AddEditorHandlers(edit);
}
WorkbenchServiceFactory.CodeCompletionParserController.RegisterFileForParsing(tabName + ".pas");
//edit.FileName = FileName;
//edit.file_name = file_name;
//SetTabPageText(edit);
}
@ -598,7 +598,7 @@ namespace VisualPascalABC
public void AddTextToOutputWindowSync(string fileName, string text)
{
//BeginInvoke(new SetFileNameAndTextDelegate(AddTextToOutputWindow), fileName, text);
//BeginInvoke(new SetFileNameAndTextDelegate(AddTextToOutputWindow), file_name, text);
Invoke(new SetFileNameAndTextDelegate(AddTextToOutputWindow), fileName, text);
}

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/></startup>
<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2"/>

View file

@ -11,7 +11,7 @@ namespace ICSharpCode.TextEditor.Document
/// </summary>
/* public class TestFoldingStrategy : IFoldingStrategy
{
public List<FoldMarker> GenerateFoldMarkers(IDocument document, string fileName, object parseInformation)
public List<FoldMarker> GenerateFoldMarkers(IDocument document, string file_name, object parseInformation)
{
List<FoldMarker> l = new List<FoldMarker>();
Stack<int> offsetStack = new Stack<int>();

View file

@ -23,7 +23,7 @@ namespace VisualPascalABC
{
SourceLocation sl = null;
/*if (lines_to_locations.TryGetValue(LineNum, out sl))
if (sl.FileName == FileName)
if (sl.file_name == file_name)
{
sl.BeginPosition.Column = sl.EndPosition.Column = ColumnNum;
locations.Remove(sl);

View file

@ -246,7 +246,7 @@ namespace VisualPascalABC
public void SendText(string FileName, string Text)
{
//messageServer.SendText(FileName, Text);
//messageServer.SendText(file_name, Text);
}
/*private void MessageQueueReceive_Callback(IAsyncResult ar)

View file

@ -250,7 +250,7 @@ namespace VisualPascalABC
return ed.Document.TextContent;
if (!File.Exists(FileName))
return null;
/*TextReader tr = new StreamReader(FileName, System.Text.Encoding.GetEncoding(1251));
/*TextReader tr = new StreamReader(file_name, System.Text.Encoding.GetEncoding(1251));
string Text = tr.ReadToEnd();
tr.Close();*/
string Text = PascalABCCompiler.FileReader.ReadFileContent(FileName, null);

View file

@ -104,16 +104,16 @@ namespace VisualPascalABC.Avalon
public void UpdateFolding()
{
CodeCompletionParserController.open_files[this.FileName] = true;
CodeCompletionParserController.open_files[this.file_name] = true;
}
public void UpdateFolding(object parseInfo, string fileName)
public void UpdateFolding(object parseInfo, string file_name)
{
try
{
if (EnableFolding && fileName == this.FileName)
if (EnableFolding && file_name == this.file_name)
{
foldingManager.UpdateFoldings(fileName, parseInfo);
foldingManager.UpdateFoldings(file_name, parseInfo);
refresh_Folding();
}
}

View file

@ -521,10 +521,10 @@ namespace VisualPascalABC
List<PascalABCCompiler.Errors.CompilerWarning> Warnings = new List<PascalABCCompiler.Errors.CompilerWarning>();
//PascalABCCompiler.SyntaxTree.syntax_tree_node sn =
// MainForm.VisualEnvironmentCompiler.Compiler.ParsersController.Compile(
// FileName, TextEditor.Text, null, Errors, PascalABCCompiler.Parsers.ParseMode.Normal);
// file_name, TextEditor.Text, null, Errors, PascalABCCompiler.Parsers.ParseMode.Normal);
PascalABCCompiler.SyntaxTree.compilation_unit sn =
CodeCompletion.CodeCompletionController.ParsersController.GetCompilationUnit(
VisualPABCSingleton.MainForm._currentCodeFileDocument.FileName,
VisualPABCSingleton.MainForm._currentCodeFileDocument.file_name,
existing_text, //VisualPascalABC.Form1.Form1_object._currentCodeFileDocument.TextEditor.Text,
Errors,
Warnings);

View file

@ -140,7 +140,7 @@ namespace VisualPascalABC
MainForm.ExecuteErrorPos(er.SourceLocation, 2);
else // ImageIndex==2 - ошибка выполнения
MainForm.ExecuteErrorPos(er.SourceLocation, 1);
//OpenFile(er.SourceLocation.FileName);
//OpenFile(er.SourceLocation.file_name);
//(tabControl1.SelectedTab.ag as CodeFileDocumentControl).TextEditor.CaretPosition(er.SourceLocation.BeginPosition.Line,er.SourceLocation.BeginPosition.Column);
}
}

View file

@ -711,7 +711,7 @@ namespace VisualPascalABC
case VisualEnvironmentCompilerAction.OpenFile:
return WorkbenchServiceFactory.FileService.OpenFile((string)obj, null);
case VisualEnvironmentCompilerAction.GetDirectory:
string s=VisualEnvironmentCompiler.Compiler.CompilerOptions.StandartDirectories[(string)obj] as string;
string s=VisualEnvironmentCompiler.Compiler.CompilerOptions.StandardDirectories[(string)obj] as string;
if (s != null)
return s;
return WorkbenchStorage.StandartDirectories[(string)obj] as string;

View file

@ -600,7 +600,7 @@ namespace VisualPascalABC
List<PascalABCCompiler.Errors.Error> Errors = new List<PascalABCCompiler.Errors.Error>();
//PascalABCCompiler.SyntaxTree.syntax_tree_node sn =
// MainForm.VisualEnvironmentCompiler.Compiler.ParsersController.Compile(
// FileName, TextEditor.Text, null, Errors, PascalABCCompiler.Parsers.ParseMode.Normal);
// file_name, TextEditor.Text, null, Errors, PascalABCCompiler.Parsers.ParseMode.Normal);
string text = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.SourceFilesProvider(VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName, PascalABCCompiler.SourceFileOperation.GetText) as string;
PascalABCCompiler.SyntaxTree.compilation_unit cu =
CodeCompletion.CodeCompletionController.ParsersController.GetCompilationUnitForFormatter(

View file

@ -177,7 +177,7 @@ namespace VisualPascalABC
open_files[FileName] = false;
if (dc.is_compiled)
{
//CodeCompletion.CodeCompletionController.comp_modules.Remove(FileName);
//CodeCompletion.CodeCompletionController.comp_modules.Remove(file_name);
if (tmp != null && tmp.visitor.entry_scope != null)
{
tmp.visitor.entry_scope.Clear();

View file

@ -236,7 +236,7 @@ namespace VisualPascalABC
if (dconv == null) return new List<SymbolsViewerSymbol>();
List<SymbolsViewerSymbol> lst = InternalFindReferences(fileName, e, line, column, for_refact);
//if (lst != null && expr != null && for_refact)
//lst.Insert(0,new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(fileName,line+1,column,line+1,column+expr.Length),ImagesProvider.IconNumberGotoText));
//lst.Insert(0,new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(file_name,line+1,column,line+1,column+expr.Length),ImagesProvider.IconNumberGotoText));
return lst;
}
@ -572,7 +572,7 @@ namespace VisualPascalABC
controller = new CodeCompletion.CodeCompletionController();
int off = textArea.Caret.Offset;
string text = textArea.Document.TextContent.Substring(0, textArea.Caret.Offset);
//controller.Compile(fileName, text /*+ ")))));end."*/);
//controller.Compile(file_name, text /*+ ")))));end."*/);
FileName = fileName; Text = text;
ICompletionData[] data = GetCompletionData(off, text, textArea.Caret.Line, textArea.Caret.Column, charTyped, keyw);
CodeCompletion.AssemblyDocCache.CompleteDocumentation();
@ -626,7 +626,7 @@ namespace VisualPascalABC
controller = new CodeCompletion.CodeCompletionController();
int off = textArea.Caret.Offset;
string text = textArea.Document.TextContent.Substring(0, textArea.Caret.Offset);
//controller.Compile(fileName, text /*+ ")))));end."*/);
//controller.Compile(file_name, text /*+ ")))));end."*/);
FileName = fileName; Text = text;
ICompletionData[] data = GetCompletionDataByFirst(off, text, textArea.Caret.Line, textArea.Caret.Column, charTyped, keyw);
CodeCompletion.AssemblyDocCache.CompleteDocumentation();

View file

@ -317,7 +317,7 @@ namespace VisualPascalABC
{
// Still needed ?
/*if (currentCompilationUnit == null) {
currentCompilationUnit = (ICompilationUnit)ParserService.GetParseInformation(Path.GetFullPath(textAreaControl.FileName)).MostRecentCompilationUnit;
currentCompilationUnit = (ICompilationUnit)ParserService.GetParseInformation(Path.GetFullPath(textAreaControl.file_name)).MostRecentCompilationUnit;
}*/
autoselect = false;
@ -803,7 +803,7 @@ namespace VisualPascalABC
{
//textAreaControl.ActiveTextAreaControl.Caret.Position = new ICSharpCode.TextEditor.TextLocation(item.Column, item.Line);
//textAreaControl.ActiveTextAreaControl.TextArea.Focus();
//VisualPABCSingleton.MainForm.ExecuteSourceLocationAction(new PascalABCCompiler.SourceLocation(textAreaControl.FileName,item.Line+1,item.Column,
//VisualPABCSingleton.MainForm.ExecuteSourceLocationAction(new PascalABCCompiler.SourceLocation(textAreaControl.file_name,item.Line+1,item.Column,
// item.EndLine+1,item.Column),VisualPascalABCPlugins.SourceLocationAction.NavigationGoto);
VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.ExecuteSourceLocationAction(
new PascalABCCompiler.SourceLocation(textAreaControl.FileName, item.Line + 1, item.Column + 1, item.Line + 1, item.Column + 1), VisualPascalABCPlugins.SourceLocationAction.GotoBeg);

View file

@ -156,7 +156,7 @@ namespace VisualPascalABC
{
ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider;
if (tecp != null)
SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
SetPosition(tecp.TextEditorControl.file_name, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
else
Remove();
}*/
@ -269,7 +269,7 @@ namespace VisualPascalABC
static int endLine;
static int endColumn;
//public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerEndLine)
//public static void SetPosition(string file_name, IDocument document, int makerStartLine, int makerEndLine)
public static void SetPosition(TextEditorControl ctrl, int makerStartLine)
{
try
@ -342,7 +342,7 @@ namespace VisualPascalABC
static int endLine;
static int endColumn;
//public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerEndLine)
//public static void SetPosition(string file_name, IDocument document, int makerStartLine, int makerEndLine)
public static void SetPosition(TextEditorControl ctrl, int makerStartLine)
{
try
@ -426,7 +426,7 @@ namespace VisualPascalABC
{
ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider;
if (tecp != null)
SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
SetPosition(tecp.TextEditorControl.file_name, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
else
Remove();
}*/

View file

@ -362,7 +362,7 @@ namespace VisualPascalABC
}
/// <summary>
/// Добавить Breakpoint в файл fileName строку line
/// Добавить Breakpoint в файл file_name строку line
/// </summary>
public Mono.Debugging.Client.Breakpoint AddBreakPoint(string fileName, int line, bool commonBreakpoint)
{
@ -387,7 +387,7 @@ namespace VisualPascalABC
}
/// <summary>
/// Получить список Breakpointov в файле fileName
/// Получить список Breakpointov в файле file_name
/// </summary>
public List<Mono.Debugging.Client.Breakpoint> GetBreakpointsInFile(string fileName)
{
@ -432,11 +432,11 @@ namespace VisualPascalABC
dbg.ProcessExited += debugProcessExit;
dbg.BreakpointHit += debugBreakpointHit;
//if (brPoint != null) dbg.RemoveBreakpoint(brPoint);
this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(fileName) + ".pas";
this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(file_name) + ".pas";
this.FullFileName = Path.Combine(Path.GetDirectoryName(fileName), this.FileName);
this.ExeFileName = fileName;
this.PrevFullFileName = FullFileName;
//if (need_first_brpt) brPoint = dbg.AddBreakpoint(FileName, workbench.VisualEnvironmentCompiler.Compiler.BeginOffset);
//if (need_first_brpt) brPoint = dbg.AddBreakpoint(file_name, workbench.VisualEnvironmentCompiler.Compiler.BeginOffset);
AssemblyHelper.LoadAssembly(fileName);
debuggedProcess = dbg.Start(fileName, workingDirectory, arguments);
SelectProcess(debuggedProcess);
@ -484,7 +484,7 @@ namespace VisualPascalABC
sourceFileName = workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileName;
else
sourceFileName = ProjectFactory.Instance.CurrentProject.MainFile;
this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(fileName) + ".pas";
this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(file_name) + ".pas";
this.FullFileName = Path.Combine(Path.GetDirectoryName(fileName), this.FileName);
this.ExeFileName = fileName;
CurrentLine = 0;
@ -508,7 +508,7 @@ namespace VisualPascalABC
sourceFileName = workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileName;
else
sourceFileName = ProjectFactory.Instance.CurrentProject.MainFile;
this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(fileName) + ".pas";
this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(file_name) + ".pas";
this.FullFileName = Path.Combine(Path.GetDirectoryName(fileName), this.FileName);
this.ExeFileName = fileName;
CurrentLine = 0;
@ -519,7 +519,7 @@ namespace VisualPascalABC
Mono.Debugging.Client.DebuggerSessionOptions dso = new Mono.Debugging.Client.DebuggerSessionOptions();
dso.EvaluationOptions = Mono.Debugging.Client.EvaluationOptions.DefaultOptions.Clone();
//monoDebuggerSession.AttachToProcess(new Mono.Debugging.Client.ProcessInfo(handle, fileName), dso);
//monoDebuggerSession.AttachToProcess(new Mono.Debugging.Client.ProcessInfo(handle, file_name), dso);
Mono.Debugging.Soft.SoftDebuggerStartInfo dsi = new Mono.Debugging.Soft.SoftDebuggerStartInfo("", new Dictionary<string, string>());
dsi.Command = fileName;
dsi.Arguments = args;
@ -552,7 +552,7 @@ namespace VisualPascalABC
workbench.ServiceContainer.EditorService.SetEditorDisabled(true);
TooltipServiceManager.hideToolTip();
IsRunning = true;
//evaluator = new ExpressionEvaluator(e.Process, workbench.VisualEnvironmentCompiler, FileName);
//evaluator = new ExpressionEvaluator(e.Process, workbench.VisualEnvironmentCompiler, file_name);
var process = (Mono.Debugger.Soft.VirtualMachineManager.currentProcess as Mono.Debugger.Soft.ProcessWrapper).Process;
process.Exited += Process_Exited;
return (Mono.Debugger.Soft.VirtualMachineManager.currentProcess as Mono.Debugger.Soft.ProcessWrapper).Process;
@ -741,7 +741,7 @@ namespace VisualPascalABC
public void SetFirstBreakpoint(string fileName, int line)
{
//brPoint = dbg.AddBreakpoint(fileName, line);
//brPoint = dbg.AddBreakpoint(file_name, line);
brPoint = new Mono.Debugging.Client.Breakpoint(fileName, line, 1);
monoDebuggerSession.Breakpoints.Add(brPoint);
}
@ -1199,7 +1199,7 @@ namespace VisualPascalABC
}
}
}
//CurrentLineBookmark.SetPosition(stackFrame.SourceLocation.FileName, curPage.TextEditor.Document, stackFrame.SourceLocation.Line, 1, stackFrame.SourceLocation.Line,
//CurrentLineBookmark.SetPosition(stackFrame.SourceLocation.file_name, curPage.TextEditor.Document, stackFrame.SourceLocation.Line, 1, stackFrame.SourceLocation.Line,
// len);
curPage.TextEditor.ActiveTextAreaControl.Invoke(new JumpToLineDelegate(JumpToLineInvoke), stackFrame.SourceLocation.Line - 1);
@ -2178,7 +2178,7 @@ namespace VisualPascalABC
{
try
{
//cur_brpt = dbg.AddBreakpoint(new SourcecodeSegment((frm.CurrentTabPage.ag as CodeFileDocumentControl).FileName,(frm.CurrentTabPage.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Line + 1,(frm.CurrentTabPage.Tag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Column + 1,
//cur_brpt = dbg.AddBreakpoint(new SourcecodeSegment((frm.CurrentTabPage.ag as CodeFileDocumentControl).file_name,(frm.CurrentTabPage.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Line + 1,(frm.CurrentTabPage.Tag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Column + 1,
// (frm.CurrentTabPage.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Column+100), true);
workbench.WidgetController.SetStartDebugDisabled();
currentBreakpoint = monoDebuggerSession.Breakpoints.Add(WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.FileName, WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Caret.Line + 1);

View file

@ -196,8 +196,8 @@ namespace Mono.Debugging.Evaluation
if (trace == null)
return ObjectValue.CreateUnknown ("StackTrace");
var regex = new Regex ("at (?<MethodName>.*) in (?<FileName>.*):(?<LineNumber>\\d+)(,(?<Column>\\d+))?");
var regexLine = new Regex ("at (?<MethodName>.*) in (?<FileName>.*):line (?<LineNumber>\\d+)(,(?<Column>\\d+))?");
var regex = new Regex ("at (?<MethodName>.*) in (?<file_name>.*):(?<LineNumber>\\d+)(,(?<Column>\\d+))?");
var regexLine = new Regex ("at (?<MethodName>.*) in (?<file_name>.*):line (?<LineNumber>\\d+)(,(?<Column>\\d+))?");
var frames = new List<ObjectValue> ();
foreach (var sframe in trace.Split ('\n')) {
@ -215,14 +215,14 @@ namespace Mono.Debugging.Evaluation
var match = regex.Match (text);
if (match.Success) {
text = match.Groups ["MethodName"].ToString ();
file = match.Groups ["FileName"].ToString ();
file = match.Groups ["file_name"].ToString ();
int.TryParse (match.Groups ["LineNumber"].ToString (), out line);
int.TryParse (match.Groups ["Column"].ToString (), out column);
} else {
match = regexLine.Match (text);
if (match.Success) {
text = match.Groups ["MethodName"].ToString ();
file = match.Groups ["FileName"].ToString ();
file = match.Groups ["file_name"].ToString ();
int.TryParse (match.Groups ["LineNumber"].ToString (), out line);
int.TryParse (match.Groups ["Column"].ToString (), out column);
}

View file

@ -493,7 +493,7 @@ namespace Mono.Debugging.Soft
var parameters = eval.GetParameters (ctx);
var startInfo = parameters.First();
var exe = (string) startInfo.GetChild ("FileName", evalOptions).GetRawValue (evalOptions);
var exe = (string) startInfo.GetChild ("file_name", evalOptions).GetRawValue (evalOptions);
// The process being launched is a mono process if the target file is a .exe or .dll, or if the launcher is mono.

View file

@ -75,7 +75,7 @@ namespace Mono.Debugging.Soft
{
// Get the exe and arguments from the start info and store them
this.arguments = (string)startInfo.GetChild ("Arguments", ops).GetRawValue (ops);
this.exe = (string)startInfo.GetChild ("FileName", ops).GetRawValue (ops);
this.exe = (string)startInfo.GetChild ("file_name", ops).GetRawValue (ops);
// Create the new session and custom start arguments.
// The actual arguments don't matter much since we'll use a custom launcher for the process.
@ -124,7 +124,7 @@ namespace Mono.Debugging.Soft
startInfo.GetChild ("Arguments", ops).SetRawValue (debuggerArgs + " " + arguments, ops);
} else {
startInfo.GetChild ("Arguments", ops).SetRawValue (debuggerStartInfo.Arguments, ops);
startInfo.GetChild ("FileName", ops).SetRawValue (debuggerStartInfo.FileName, ops);
startInfo.GetChild ("file_name", ops).SetRawValue (debuggerStartInfo.FileName, ops);
}
return true;
}
@ -165,7 +165,7 @@ namespace Mono.Debugging.Soft
// Assign the original exe and arguments to the start info object
startInfo.GetChild ("Arguments", ctx.Options).SetRawValue (arguments, ctx.Options);
startInfo.GetChild ("FileName", ctx.Options).SetRawValue (exe, ctx.Options);
startInfo.GetChild ("file_name", ctx.Options).SetRawValue (exe, ctx.Options);
// Signal TargetProcessLauncher that the process has started and the process ID is available.
startedEvent.Set ();

View file

@ -224,7 +224,7 @@ namespace VisualPascalABC
catch
{
}
this.tbAppIcon.Text = Path.GetFileName(openFileDialog1.FileName);//PascalABCCompiler.Tools.RelativePathTo(ProjectFactory.Instance.CurrentProject.ProjectDirectory, openFileDialog1.FileName);
this.tbAppIcon.Text = Path.GetFileName(openFileDialog1.FileName);//PascalABCCompiler.Tools.RelativePathTo(ProjectFactory.Instance.CurrentProject.ProjectDirectory, openFileDialog1.file_name);
}
}

View file

@ -69,13 +69,13 @@ namespace VisualPascalABC
if (Path.GetDirectoryName(CompilerOptions1.SourceFileName).ToLower() == ((string)WorkbenchStorage.StandartDirectories[Constants.LibSourceDirectoryIdent]).ToLower())
Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = false;
if (RuntimeServicesModule != null)
CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandardModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
string ofn = Workbench.VisualEnvironmentCompiler.Compile(CompilerOptions1);
Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = savePCU;
if (RuntimeServicesModule != null)
CompilerOptions1.RemoveStandartModuleAtIndex(CompilerOptions1.StandartModules.Count - 1);
CompilerOptions1.RemoveStandardModuleAtIndex(CompilerOptions1.StandardModules.Count - 1);
if (Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count != 0 || Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0)
{
@ -109,9 +109,9 @@ namespace VisualPascalABC
CompilerOptions1.RunWithEnvironment = RunWithEnvironment;
//string runtimeModuleFileName = CompilerOptions1.SearchDirectory + "\\" + RuntimeServicesModule;
//if (RuntimeServicesModule!=null && File.Exists(runtimeModuleFileName))
// CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
// CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
if (RuntimeServicesModule != null)
CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandardModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
ErrorsList.Clear();
@ -126,7 +126,7 @@ namespace VisualPascalABC
Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = savePCU;
if (RuntimeServicesModule != null)
CompilerOptions1.RemoveStandartModuleAtIndex(CompilerOptions1.StandartModules.Count - 1);
CompilerOptions1.RemoveStandardModuleAtIndex(CompilerOptions1.StandardModules.Count - 1);
//MessageBox.Show(Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count.ToString());
if (Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count != 0 || Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0)
@ -160,16 +160,16 @@ namespace VisualPascalABC
CompilerOptions1.RunWithEnvironment = RunWithEnvironment;
//string runtimeModuleFileName = CompilerOptions1.SearchDirectory + "\\" + RuntimeServicesModule;
//if (RuntimeServicesModule!=null && File.Exists(runtimeModuleFileName))
// CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
// CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
if (__RuntimeServicesModule != null)
CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandardModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
ErrorsList.Clear();
//CompilerOptions1.SavePCUInThreadPull = true;
__savePCU = Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate;
//if (Path.GetDirectoryName(FileName).ToLower() == ((string)StandartDirectories[Constants.LibSourceDirectoryIdent]).ToLower())
//if (Path.GetDirectoryName(file_name).ToLower() == ((string)StandartDirectories[Constants.LibSourceDirectoryIdent]).ToLower())
// VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = false;
Workbench.VisualEnvironmentCompiler.Compiler.OnChangeCompilerState += CompilationOnChangeCompilerState;
@ -196,9 +196,9 @@ namespace VisualPascalABC
CompilerOptions1.RunWithEnvironment = RunWithEnvironment;
//string runtimeModuleFileName = CompilerOptions1.SearchDirectory + "\\" + RuntimeServicesModule;
//if (RuntimeServicesModule!=null && File.Exists(runtimeModuleFileName))
// CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
// CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain));
if (__RuntimeServicesModule != null)
CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
CompilerOptions1.StandardModules.Add(new PascalABCCompiler.CompilerOptions.StandardModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandardModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage));
ErrorsList.Clear();
@ -268,7 +268,7 @@ namespace VisualPascalABC
Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = __savePCU;
if (__RuntimeServicesModule != null)
CompilerOptions1.RemoveStandartModuleAtIndex(CompilerOptions1.StandartModules.Count - 1);
CompilerOptions1.RemoveStandardModuleAtIndex(CompilerOptions1.StandardModules.Count - 1);
if (Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count != 0 || Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0)
{

View file

@ -40,7 +40,7 @@ namespace VisualPascalABC
private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
{
//ReplaceLastFile(CurrentSourceFileName, saveFileDialog1.FileName);
//ReplaceLastFile(CurrentSourceFileName, saveFileDialog1.file_name);
string fn = Tools.FileNameToLower(saveFileDialog1.FileName);
if (OpenDocuments.ContainsKey(fn) && OpenDocuments[fn] != CurrentCodeFileDocument)
{

View file

@ -120,7 +120,7 @@ namespace VisualPascalABC
{
if (Path.GetExtension(FileName) == ".pas")
{
/*string XMLFile = Path.ChangeExtension(FileName, string_consts.xml_form_extention);
/*string XMLFile = Path.ChangeExtension(file_name, string_consts.xml_form_extention);
if (File.Exists(XMLFile))
{
if (not_open_designer)
@ -164,7 +164,7 @@ namespace VisualPascalABC
visualStates.FileOpened = true;//?????
if (!IsNewFile && !File.Exists(FileName))
{
//MessageBox.Show(string.Format(PascalABCCompiler.StringResources.Get("!FILE_NOT_FOUND{0}"), FileName), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
//MessageBox.Show(string.Format(PascalABCCompiler.StringResources.Get("!FILE_NOT_FOUND{0}"), file_name), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
bool exists = false;
foreach (string s in search_debug_paths)
{
@ -205,7 +205,7 @@ namespace VisualPascalABC
else
if (!IsNewFile)
{
//CheckErrorListAndClear((tabControl1.TabPages[TabIndex].ag as CodeFileDocumentControl).FileName);
//CheckErrorListAndClear((tabControl1.TabPages[TabIndex].ag as CodeFileDocumentControl).file_name);
CurrentCodeFileDocument.FileName = FileName;
if (!ProjectFactory.Instance.ProjectLoaded)
SetTabPageText(CurrentCodeFileDocument);
@ -397,7 +397,7 @@ namespace VisualPascalABC
OpenDocuments.Remove(Tools.FileNameToLower(dt.FileName));
OpenDocuments.Add(Tools.FileNameToLower(FileName), TbPage);
WorkbenchServiceFactory.CodeCompletionParserController.RenameFile(dt.FileName, FileName);
//TbPage.SaveFormFile(FileName);
//TbPage.SaveFormFile(file_name);
dt.DocumentChanged = false;
dt.FileName = FileName;
dt.DocumentSavedToDisk = true;
@ -590,7 +590,7 @@ namespace VisualPascalABC
internal bool IsForm(string FileName)
{
//string XMLFile = Path.ChangeExtension(FileName, string_consts.xml_form_extention);
//string XMLFile = Path.ChangeExtension(file_name, string_consts.xml_form_extention);
// return File.Exists(XMLFile);
return false;
}

View file

@ -465,8 +465,8 @@ namespace VisualPascalABC
clicked_stop_debug_in_menu = false;
this.mDEBUGENDToolStripMenuItem.Enabled = false;
//Data fileInfo = debuggedPage.ag as CodeFileDocumentControl;
//debuggedPage.Text = Path.GetFileName(fileInfo.FileName);
//debuggedPage.ToolTipText = fileInfo.FileName;
//debuggedPage.Text = Path.GetFileName(fileInfo.file_name);
//debuggedPage.ToolTipText = fileInfo.file_name;
SetTabPageText(debuggedPage);
ChangeDebugButtons(false);
SaveDebugContext();

View file

@ -257,7 +257,7 @@ namespace VisualPascalABC
SetTabPageText(edit);
edit.SetHighlightingStrategyForFile(FileName);
OpenDocuments.Add(Tools.FileNameToLower(FileName), edit);
//this.codeCompletionParserController.SetAsChanged(FileName);
//this.codeCompletionParserController.SetAsChanged(file_name);
//ivan
AddBreakPointHandler(edit, FileName);
var RunService = WorkbenchServiceFactory.RunService;
@ -483,7 +483,7 @@ namespace VisualPascalABC
AddEditorHandlers(edit);
}
WorkbenchServiceFactory.CodeCompletionParserController.RegisterFileForParsing(tabName + ".pas");
//edit.FileName = FileName;
//edit.file_name = file_name;
//SetTabPageText(edit);
}
@ -573,7 +573,7 @@ namespace VisualPascalABC
public void AddTextToOutputWindowSync(string fileName, string text)
{
//BeginInvoke(new SetFileNameAndTextDelegate(AddTextToOutputWindow), fileName, text);
//BeginInvoke(new SetFileNameAndTextDelegate(AddTextToOutputWindow), file_name, text);
Invoke(new SetFileNameAndTextDelegate(AddTextToOutputWindow), fileName, text);
}

View file

@ -206,7 +206,7 @@ namespace VisualPascalABCPlugins
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.Compiler.ParsersController.Compile(FileName, FileText, Errors, PascalABCCompiler.ParserTools.ParseMode.Expression);
//PascalABCCompiler.SyntaxTree.syntax_tree_node sn = VisualEnvironmentCompiler.Compiler.ParsersController.Compile(file_name, FileText, Errors, PascalABCCompiler.ParserTools.ParseMode.Expression);
PascalABCCompiler.SyntaxTree.syntax_tree_node sn = VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression(FileName, FileText, Errors, Warnings);
if (Errors.Count > 0)
StatusLabel.Text = Errors.Count + " errors";

6
bin/GPPG.dll.config Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

View file

@ -67,7 +67,7 @@ namespace PascalABCCompiler
return text;
if (!File.Exists(FileName))
return null;
/*TextReader tr = new StreamReader(FileName, System.Text.Encoding.GetEncoding(1251));
/*TextReader tr = new StreamReader(file_name, System.Text.Encoding.GetEncoding(1251));
text = tr.ReadToEnd();
tr.Close();*/
text = PascalABCCompiler.FileReader.ReadFileContent(FileName, null);
@ -267,13 +267,13 @@ namespace PascalABCCompiler
sendWorkingSet();
break;
case ConsoleCompilerConstants.CompilerOptionsClearStandartModules:
compiler.CompilerOptions.StandartModules.Clear();
compiler.CompilerOptions.StandardModules.Clear();
break;
case ConsoleCompilerConstants.CompilerOptionsStandartModule:
CompilerOptions.StandartModule sm = new CompilerOptions.StandartModule(args[0],
(CompilerOptions.StandartModuleAddMethod)Convert.ToInt32(args[1]),
CompilerOptions.StandardModule sm = new CompilerOptions.StandardModule(args[0],
(CompilerOptions.StandardModuleAddMethod)Convert.ToInt32(args[1]),
(PascalABCCompiler.SyntaxTree.LanguageId)Convert.ToInt32(args[2]));
compiler.CompilerOptions.StandartModules.Add(sm);
compiler.CompilerOptions.StandardModules.Add(sm);
break;
case ConsoleCompilerConstants.InternalDebug:
compiler.InternalDebug = (CompilerInternalDebug)ReadObject();

View file

@ -347,7 +347,7 @@ namespace PascalABCCompiler
FileName = string.Format("[{0}]{1} {2}...", Math.Round((DateTime.Now - StartTime).TotalMilliseconds), State, System.IO.Path.GetFileName(FileName));
StartTime = DateTime.Now;
Console.WriteLine(FileName);
//Console.Title = FileName;
//Console.Title = file_name;
}
else
{

View file

@ -66,7 +66,7 @@ namespace PascalABCCompiler
return text;
if (!File.Exists(FileName))
return null;
/*TextReader tr = new StreamReader(FileName, System.Text.Encoding.GetEncoding(1251));
/*TextReader tr = new StreamReader(file_name, System.Text.Encoding.GetEncoding(1251));
text = tr.ReadToEnd();
tr.Close();*/
text = PascalABCCompiler.FileReader.ReadFileContent(FileName, null);
@ -245,13 +245,13 @@ namespace PascalABCCompiler
sendWorkingSet();
break;
case ConsoleCompilerConstants.CompilerOptionsClearStandartModules:
compiler.CompilerOptions.StandartModules.Clear();
compiler.CompilerOptions.StandardModules.Clear();
break;
case ConsoleCompilerConstants.CompilerOptionsStandartModule:
CompilerOptions.StandartModule sm = new CompilerOptions.StandartModule(args[0],
(CompilerOptions.StandartModuleAddMethod)Convert.ToInt32(args[1]),
CompilerOptions.StandardModule sm = new CompilerOptions.StandardModule(args[0],
(CompilerOptions.StandardModuleAddMethod)Convert.ToInt32(args[1]),
(PascalABCCompiler.SyntaxTree.LanguageId)Convert.ToInt32(args[2]));
compiler.CompilerOptions.StandartModules.Add(sm);
compiler.CompilerOptions.StandardModules.Add(sm);
break;
case ConsoleCompilerConstants.InternalDebug:
compiler.InternalDebug = (CompilerInternalDebug)ReadObject();