-
-
Save jasondown/d716263a35ad32c9cc389e297c52f4e8 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 ObjectHeaderState : ParserState | |
{ | |
private Regex _regex; | |
private int _objectTypeIndex; | |
private int _objectIdIndex; | |
public ObjectHeaderState(Parser parser) | |
: base(parser) | |
{ | |
InitRegex(); | |
} | |
private void InitRegex() | |
{ | |
// regex used to pull out object type and id | |
} | |
public override void ReadLine(string line) | |
{ | |
var match = _regex.Match(line); | |
if (match.Success) | |
{ | |
// add object to dependency graph if it | |
// is on the list of imported objects | |
} | |
// If we hit OBJECT-PROPERTIES move to next | |
// state (object properties), otherwise, just ignore | |
// this line. | |
else if (line.IndexOf("object-properties", StringComparison.OrdinalIgnoreCase) >= 0) | |
{ | |
Parser.SetState(Parser.ObjectPropertiesState); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment