PodFacetsParser is a light weight parser used to parse the facets of a pod definition before a the full compilation.
Slots
-
private TokenVal? consume(Token? kind := null)
Consume the current token and return consumed token. If kind is non-null then verify first
-
private Str consumeId()
Verify current is an identifier, consume it, and return it.
-
private TokenVal? cur
-
private Token? curt
-
private Void eos()
-
private CompilerErr err(Str msg, Loc? loc := null)
Throw a CompilerError for current location
- getSource
-
Obj? get(Str qname, Bool checked := true, Type expected := Obj?#)
Get a pod facet with its qualified name. If it doesn't exist then throw CompilerErr or return null depending on checked parameter. If expected is passed and resulting value does not fit type then throw CompilerErr. NOTE: currently we don't do any namespace resolution
- keysSource
-
Str[] keys()
List the keys we parsed. NOTE: currently we don't do any namespace resolution
- locSource
-
Loc loc
- mainSource
- makeSource
-
Construct with location and source.
- parseSource
-
This parse()
Parse the facets, if there is a tokenize error then throw CompilerErr. Return this.
-
private Void parseFacet()
-
private Void parseHeader()
-
private Void parseUsing()
- podNameSource
-
readonly Str podName := "?"
Pod name
-
private Int pos
-
static private Void print(PodFacetsParser p, Str key, Type expected := Obj?#)
-
private Str source
-
private Bool tokenize()
-
private TokenVal[] tokens
-
private Str usings
-
private Void verify(Token kind)
Check that the current token matches the specified type, but do not consume it.