📄 parser.frame.old
字号:
/*
Parser.frame file for NRefactory.
*/
using System;
using System.Reflection;
-->namespace
-->tokens
internal class Parser : AbstractParser
{
-->constants
const bool T = true;
const bool x = false;
-->declarations
/*
-->pragmas
*/
-->productions
public Parser(ILexer lexer) : base(lexer)
{
}
public override void Parse()
{
-->parseRoot
}
protected void ExpectWeak(int n, int follow)
{
if (lexer.LookAhead.kind == n) {
lexer.NextToken();
} else {
SynErr(n);
while (!StartOf(follow)) {
lexer.NextToken();
}
}
}
protected bool WeakSeparator(int n, int syFol, int repFol)
{
bool[] s = new bool[maxT + 1];
if (lexer.LookAhead.kind == n) {
lexer.NextToken();
return true;
} else if (StartOf(repFol)) {
return false;
} else {
for (int i = 0; i <= maxT; i++) {
s[i] = set[syFol, i] || set[repFol, i] || set[0, i];
}
SynErr(n);
while (!s[lexer.LookAhead.kind]) {
lexer.NextToken();
}
return StartOf(syFol);
}
}
protected override void SynErr(int line, int col, int errorNumber)
{
errors.count++;
string s;
switch (errorNumber) {
-->errors
default: s = "error " + errorNumber; break;
}
errors.Error(line, col, s);
}
protected bool StartOf(int s)
{
return set[s, lexer.LookAhead.kind];
}
static bool[,] set = {
-->initialization
};
} // end Parser
$$$
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -