intellisense for hiddennames

This commit is contained in:
Ivan Bondarev 2024-04-07 11:02:01 +02:00
parent 2472de3109
commit 21c317b303
5 changed files with 64 additions and 44 deletions

View file

@ -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();
}

View file

@ -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 <ABCPascal.lex>
// GPLEX frame file <embedded resource>
//
@ -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;

View file

@ -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; }
\<\<expression\>\> { return (int)Tokens.tkParseModeExpression; }
\<\<statement\>\> { return (int)Tokens.tkParseModeStatement; }
\<\<type\>\> { return (int)Tokens.tkParseModeType; }
\<\<expression\>\> { ExprMode = true; return (int)Tokens.tkParseModeExpression; }
\<\<statement\>\> { ExprMode = true; return (int)Tokens.tkParseModeStatement; }
\<\<type\>\> { 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);

View file

@ -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 <D:\PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y>
// Machine: DESKTOP-2BJCJ7I
// DateTime: 07.04.2024 10:50:30
// UserName: ibond
// Input file <ABCPascal.y>
// options: no-lines gplex
@ -60,7 +60,7 @@ public abstract class ScanBase : AbstractScanner<PascalABCSavParser.Union,LexLoc
public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, LexLocation>
{
// Verbatim content from D:\PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y
// Verbatim content from ABCPascal.y
// Э<>об<D0BE>?явления добавля<D0BB>?<3F>?ся в класс GPPGParser, п<>?едс<D0B4>?авля<D0BB>?<3F>?ий собой па<D0BF>?се<D181>?, гене<D0BD><>?<3F>?ем<D0B5>сис<D0B8>?емой gppg
public syntax_tree_node root; // <20>?о<>?невой <20>?зел син<D0B8>?акси<D181>?еского де<D0B4>?ева
@ -72,7 +72,7 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
public ParserLambdaHelper lambdaHelper = new ParserLambdaHelper();
public GPPGParser(AbstractScanner<PascalABCSavParser.Union, LexLocation> 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<int, string> aliasses;

View file

@ -1242,12 +1242,6 @@
<member name="M:PointerToString(System.Void*)">
<summary>Преобразует указатель к строковому представлению</summary>
</member>
<member name="M:TypeToTypeName(System.Type)">
<summary>Для типа System.Type возвращает имя типа объекта</summary>
</member>
<member name="M:TypeName(System.Object)">
<summary>Возвращает имя типа объекта</summary>
</member>
<member name="M:Exec(System.String)">
<summary>Запускает программу или документ с именем fileName</summary>
</member>
@ -2626,9 +2620,33 @@
<member name="M:GetRuntimeSize``1">
<summary>Вычисление размера типа на этапе выполнения</summary>
</member>
<member name="M:TypeToTypeName(System.Type)">
<summary>Для типа System.Type возвращает имя типа объекта</summary>
</member>
<member name="M:TypeToTypeName(System.Type,System.Text.StringBuilder)">
<summary>Для типа System.Type записывает в res имя типа объекта</summary>
</member>
<member name="M:TypeToTypeName(System.Type,System.IO.TextWriter)">
<summary>Для типа System.Type записывает в res имя типа объекта</summary>
</member>
<member name="M:TypeName(System.Object)">
<summary>Возвращает имя типа объекта</summary>
</member>
<member name="M:TypeName(System.Object,System.Text.StringBuilder)">
<summary>Записывает в res имя типа объекта</summary>
</member>
<member name="M:TypeName(System.Object,System.IO.TextWriter)">
<summary>Записывает в res имя типа объекта</summary>
</member>
<member name="M:_ObjectToString(System.Object)">
<summary>Возвращает строку для вывода в write</summary>
</member>
<member name="M:_ObjectToString(System.Object,System.Text.StringBuilder)">
<summary>Записывает в res строку для вывода в write</summary>
</member>
<member name="M:_ObjectToString(System.Object,System.IO.TextWriter)">
<summary>Записывает в res строку для вывода в write</summary>
</member>
<member name="M:ExecuteAssemlyIsDll">
<summary>--</summary>
</member>