-
-
Save jasondown/62ccd3298ad2680c85f5ec48d72c4d7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GlobalVariablesState : ParserState | |
{ | |
private bool _readyForVariableDeclarations; | |
public GlobalVariablesState(Parser parser) | |
: base(parser) | |
{ | |
} | |
public override void ReadLine(string line) | |
{ | |
if (line.StartsWith("procedure ", StringComparison.OrdinalIgnoreCase)) | |
{ | |
Parser.SetState(Parser.ProceduresState); | |
} | |
else if (line.IndexOf("=var", StringComparison.OrdinalIgnoreCase) > 0) | |
{ | |
_readyForVariableDeclarations = true; | |
} | |
else if (_readyForVariableDeclarations) | |
{ | |
// Uses ParseVariables from ParserState base class ParseVariable(line); | |
} | |
} | |
public override void Reset() | |
{ | |
_readyForVariableDeclarations = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment