diff --git a/ParserTools/ParserTools/DefaultLanguageInformation.cs b/ParserTools/ParserTools/DefaultLanguageInformation.cs index dd4d02c6c..dfc8ce4ed 100644 --- a/ParserTools/ParserTools/DefaultLanguageInformation.cs +++ b/ParserTools/ParserTools/DefaultLanguageInformation.cs @@ -2789,7 +2789,7 @@ namespace PascalABCCompiler.Parsers { bool end = false; char ch = Text[i]; - if (kav.Count == 0 && (char.IsLetterOrDigit(ch) || ch == '_' || ch == '&' || ch == '\'')) + if (kav.Count == 0 && (char.IsLetterOrDigit(ch) || ch == '_' || ch == '&' || ch == '\'' || ch == '`')) { num_in_ident = i; if (kav.Count == 0 && tokens.Count == 0) @@ -2817,7 +2817,7 @@ namespace PascalABCCompiler.Parsers i--; } else - while (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&')) + while (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '`')) { i--; } @@ -2833,7 +2833,7 @@ namespace PascalABCCompiler.Parsers i--; } } - if (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&')) + if (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '`')) { bound = i + 1; TestForKeyword(Text, i, ref bound, punkt_sym, out keyw); @@ -2906,7 +2906,7 @@ namespace PascalABCCompiler.Parsers if (kav.Count == 0) { string tmps = sb.ToString().Trim(' ', '\r', '\t', '\n'); - if (tmps.Length >= 1 && (char.IsLetter(tmps[0]) || tmps[0] == '_' || tmps[0] == '&' || tmps[0] == '?') && tokens.Count == 0) + if (tmps.Length >= 1 && (char.IsLetter(tmps[0]) || tmps[0] == '_' || tmps[0] == '&' || tmps[0] == '?' || tmps[0] == '`') && tokens.Count == 0) end = true; else tokens.Push(ch); @@ -2964,7 +2964,7 @@ namespace PascalABCCompiler.Parsers if (kav.Count == 0) { string tmps = sb.ToString().Trim(' ', '\r', '\t', '\n'); - if (tmps.Length >= 1 && (char.IsLetter(tmps[0]) || tmps[0] == '_' || tmps[0] == '&' || tmps[0] == '?') && tokens.Count == 0) + if (tmps.Length >= 1 && (char.IsLetter(tmps[0]) || tmps[0] == '_' || tmps[0] == '&' || tmps[0] == '?' || tmps[0] == '`') && tokens.Count == 0) end = true; else tokens.Push(ch); @@ -3003,7 +3003,7 @@ namespace PascalABCCompiler.Parsers i--; } } - if (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '?' && IsPunctuation(Text, i+1))) + if (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '`' || Text[i] == '?' && IsPunctuation(Text, i+1))) { bound = i + 1; TestForKeyword(Text, i, ref bound, punkt_sym, out keyw); @@ -3123,10 +3123,10 @@ namespace PascalABCCompiler.Parsers return ""; bool is_char = false; System.Text.StringBuilder sb = new System.Text.StringBuilder(); - if (Text[i] != ' ' && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '?' && IsPunctuation(Text, i + 1))) + if (Text[i] != ' ' && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '?' && IsPunctuation(Text, i + 1) || Text[i] == '`')) { //sb.Remove(0,sb.Length); - while (i >= 0 && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '?' && IsPunctuation(Text, i + 1))) + while (i >= 0 && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '?' && IsPunctuation(Text, i + 1) || Text[i] == '`')) { //sb.Insert(0,Text[i]);//.Append(Text[i]); i--; @@ -3134,9 +3134,9 @@ namespace PascalABCCompiler.Parsers is_char = true; } i = off; - if (i < Text.Length && Text[i] != ' ' && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '?' && IsPunctuation(Text, i + 1))) + if (i < Text.Length && Text[i] != ' ' && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '?' && IsPunctuation(Text, i + 1) || Text[i] == '`')) { - while (i < Text.Length && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_')) + while (i < Text.Length && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '`')) { //sb.Append(Text[i]);//.Append(Text[i]); i++; @@ -3234,7 +3234,7 @@ namespace PascalABCCompiler.Parsers sk_stack.Push('<'); } - else if (!char.IsLetterOrDigit(c) && c != '?' && c != '&' && c != '.' && c != ' ' && c != '\t' && c != '\n' && c != ',') + else if (!char.IsLetterOrDigit(c) && c != '?' && c != '&' && c != '.' && c != ' ' && c != '\t' && c != '\n' && c != ',' && c != '`') { break; } @@ -3368,7 +3368,7 @@ namespace PascalABCCompiler.Parsers } } else - while (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_')) + while (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '`')) { sb.Insert(0, Text[i]); i--; @@ -3396,7 +3396,7 @@ namespace PascalABCCompiler.Parsers { off -= 2; while (off >= 0 && (Text[off] == ' ' || char.IsControl(Text[off]))) off--; - if (off >= 0 && (Text[off] == '_' || char.IsLetterOrDigit(Text[off]) || Text[off] == ']' || Text[off] == '>')) + if (off >= 0 && (Text[off] == '_' || char.IsLetterOrDigit(Text[off]) || Text[off] == '`' || Text[off] == ']' || Text[off] == '>')) expr = FindExpression(off+1,Text,0,0,out keyw); } return expr; @@ -3426,13 +3426,13 @@ namespace PascalABCCompiler.Parsers { bool end = false; char ch = Text[i]; - if ((char.IsLetterOrDigit(ch) || ch == '_' || ch == '&') && !isOperator(Text, i, out next)) + if ((char.IsLetterOrDigit(ch) || ch == '_' || ch == '&' || ch == '`') && !isOperator(Text, i, out next)) { num_in_ident = i; if (kav.Count == 0 && tokens.Count == 0) { int tmp = i; - while (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&') && !isOperator(Text, i, out next)) + while (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '`') && !isOperator(Text, i, out next)) { i--; } @@ -3448,7 +3448,7 @@ namespace PascalABCCompiler.Parsers i--; } } - if (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&') && !isOperator(Text, i, out next)) + if (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '`') && !isOperator(Text, i, out next)) { bound = i + 1; TestForKeyword(Text, i, ref bound, punkt_sym, out keyw); @@ -3567,7 +3567,7 @@ namespace PascalABCCompiler.Parsers } } - if (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&')) + if (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '`')) { bound = i + 1; TestForKeyword(Text, i, ref bound, punkt_sym, out keyw); @@ -3715,7 +3715,7 @@ namespace PascalABCCompiler.Parsers if (Text[i] != ' ' && !char.IsControl(Text[i])) { sb.Remove(0,sb.Length); - while (i >= 0 && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&')) + while (i >= 0 && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '`')) { //sb.Insert(0,Text[i]);//.Append(Text[i]); i--; @@ -3725,7 +3725,7 @@ namespace PascalABCCompiler.Parsers i++; if (i < Text.Length && Text[i] != ' ' && !char.IsControl(Text[i])) { - while (i < Text.Length && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&')) + while (i < Text.Length && (Char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[i] == '&' || Text[i] == '`')) { sb.Append(Text[i]);//.Append(Text[i]); i++; @@ -3745,12 +3745,12 @@ namespace PascalABCCompiler.Parsers { System.Text.StringBuilder sb=null; is_pattern = false; - if (off > 0 && (char.IsLetterOrDigit(Text[off - 1]) || Text[off - 1] == '_' || Text[off-1] == '&')) + if (off > 0 && (char.IsLetterOrDigit(Text[off - 1]) || Text[off - 1] == '_' || Text[off-1] == '&' || Text[off - 1] == '`')) { sb = new System.Text.StringBuilder(); int i = off - 1; is_pattern = true; - while (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[off-1] == '&')) + while (i >= 0 && (char.IsLetterOrDigit(Text[i]) || Text[i] == '_' || Text[off-1] == '&' || Text[i] == '`')) sb.Insert(0, Text[i--]); return sb.ToString(); } diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index 72c1b5838..a55f597a2 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -1,9 +1,9 @@ // // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 -// Machine: DESKTOP-G8V08V4 -// DateTime: 04.04.2024 10:35:08 -// UserName: ????????? +// Machine: DESKTOP-2BJCJ7I +// DateTime: 07.04.2024 10:50:29 +// UserName: ibond // GPLEX input file // GPLEX frame file // @@ -147,6 +147,7 @@ public PT parsertools; string directiveparam; LexLocation currentLexLocation; bool HiddenIdents = false; + bool ExprMode = false; #endregion user code int state; @@ -1862,7 +1863,7 @@ string cur_yytext = yytext; currentLexLocation = CurrentLexLocation; if (res == (int)Tokens.tkIdentifier) { - if (cur_yytext[0] == '`' && !HiddenIdents) + if (cur_yytext[0] == '`' && !HiddenIdents && !ExprMode) parsertools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}",CurrentLexLocation, "`"); yylval = new Union(); yylval.id = parsertools.create_ident(cur_yytext,currentLexLocation); @@ -2108,13 +2109,13 @@ yylval = new Union(); yylval.op = new op_type_node(Operators.LessEqual); return yylval = new Union(); yylval.op = new op_type_node(Operators.NotEqual); return (int)Tokens.tkNotEqual; break; case 42: -return (int)Tokens.tkParseModeType; +ExprMode = true; return (int)Tokens.tkParseModeType; break; case 43: -return (int)Tokens.tkParseModeStatement; +ExprMode = true; return (int)Tokens.tkParseModeStatement; break; case 44: -return (int)Tokens.tkParseModeExpression; +ExprMode = true; return (int)Tokens.tkParseModeExpression; break; case 45: yylval = new Union(); yylval.op = new op_type_node(Operators.GreaterEqual); return (int)Tokens.tkGreaterEqual; diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex index 2c187002c..dad8e0fba 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex @@ -10,6 +10,7 @@ string directiveparam; LexLocation currentLexLocation; bool HiddenIdents = false; + bool ExprMode = false; %} %namespace GPPGParserScanner @@ -248,9 +249,9 @@ UNICODEARROW \x890 \u2192 { yylval = new Union(); yylval.ti = new token_info(yytext); return (int)Tokens.tkArrow; } -\<\\> { return (int)Tokens.tkParseModeExpression; } -\<\\> { return (int)Tokens.tkParseModeStatement; } -\<\\> { return (int)Tokens.tkParseModeType; } +\<\\> { ExprMode = true; return (int)Tokens.tkParseModeExpression; } +\<\\> { ExprMode = true; return (int)Tokens.tkParseModeStatement; } +\<\\> { ExprMode = true; return (int)Tokens.tkParseModeType; } \x01 { return (int)Tokens.INVISIBLE; } @@ -260,7 +261,7 @@ UNICODEARROW \x890 currentLexLocation = CurrentLexLocation; if (res == (int)Tokens.tkIdentifier) { - if (cur_yytext[0] == '`' && !HiddenIdents) + if (cur_yytext[0] == '`' && !HiddenIdents && !ExprMode) parsertools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}",CurrentLexLocation, "`"); yylval = new Union(); yylval.id = parsertools.create_ident(cur_yytext,currentLexLocation); diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 126eafd76..f86d5b34e 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -1,10 +1,10 @@ // (see accompanying GPPGcopyright.rtf) // GPPG version 1.3.6 -// Machine: DESKTOP-G8V08V4 -// DateTime: 04.04.2024 10:35:09 -// UserName: ????????? -// Input file +// Machine: DESKTOP-2BJCJ7I +// DateTime: 07.04.2024 10:50:30 +// UserName: ibond +// Input file // options: no-lines gplex @@ -60,7 +60,7 @@ public abstract class ScanBase : AbstractScanner { - // Verbatim content from D:\PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y + // Verbatim content from ABCPascal.y // Э�?и об�?явления добавля�?�?ся в класс GPPGParser, п�?едс�?авля�?�?ий собой па�?се�?, гене�?и�?�?ем�?й сис�?емой gppg public syntax_tree_node root; // �?о�?невой �?зел син�?акси�?еского де�?ева @@ -72,7 +72,7 @@ public partial class GPPGParser: ShiftReduceParser scanner) : base(scanner) { } - // End verbatim content from D:\PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y + // End verbatim content from ABCPascal.y #pragma warning disable 649 private static Dictionary aliasses; diff --git a/bin/Lib/PABCSystem.xml b/bin/Lib/PABCSystem.xml index 374f08542..39d14ae31 100644 --- a/bin/Lib/PABCSystem.xml +++ b/bin/Lib/PABCSystem.xml @@ -1242,12 +1242,6 @@ Преобразует указатель к строковому представлению - - Для типа System.Type возвращает имя типа объекта - - - Возвращает имя типа объекта - Запускает программу или документ с именем fileName @@ -2626,9 +2620,33 @@ Вычисление размера типа на этапе выполнения + + Для типа System.Type возвращает имя типа объекта + + + Для типа System.Type записывает в res имя типа объекта + + + Для типа System.Type записывает в res имя типа объекта + + + Возвращает имя типа объекта + + + Записывает в res имя типа объекта + + + Записывает в res имя типа объекта + Возвращает строку для вывода в write + + Записывает в res строку для вывода в write + + + Записывает в res строку для вывода в write + --