21 lines
604 B
C#
21 lines
604 B
C#
using Antlr4.Runtime;
|
|
|
|
namespace MicroForge.Parsing;
|
|
|
|
public abstract class PythonParserBase : Parser
|
|
{
|
|
protected PythonParserBase(ITokenStream input) : base(input)
|
|
{
|
|
}
|
|
|
|
// https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords
|
|
public bool isEqualToCurrentTokenText(string tokenText)
|
|
{
|
|
return this.CurrentToken.Text == tokenText;
|
|
}
|
|
|
|
public bool isnotEqualToCurrentTokenText(string tokenText)
|
|
{
|
|
return !this.isEqualToCurrentTokenText(tokenText); // for compatibility with the Python 'not' logical operator
|
|
}
|
|
} |