public class WyalFileParser extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
WyalFileParser.EnclosingScope
Captures all useful information about the scope in which a statement or
expression is being translated.
|
| Constructor and Description |
|---|
WyalFileParser(WyalFile file,
List<WyalFileLexer.Token> tokens) |
| Modifier and Type | Method and Description |
|---|---|
protected WyalFile.Declaration |
parseAssertDeclaration(WyalFile parent)
Parse an
assert declaration in a WyAL source file. |
WyalFile.Type |
parseDefiniteType(WyalFileParser.EnclosingScope scope)
Attempt to parse something which maybe a type, or an expression.
|
protected WyalFile.Declaration |
parseFunctionDeclaration(WyalFile parent) |
protected WyalFile.Declaration |
parseMacroDeclaration(WyalFile parent) |
protected String |
parseString(String v)
Parse a string whilst interpreting all escape characters.
|
WyalFile.Type |
parseType(WyalFileParser.EnclosingScope scope)
Parse a top-level type, which is of the form:
|
protected WyalFile.Declaration |
parseTypeDeclaration(WyalFile parent)
Parse a
type declaration in a WyAL source file. |
WyalFile |
read()
Read a
WyalFile from the token stream. |
public WyalFileParser(WyalFile file, List<WyalFileLexer.Token> tokens)
public WyalFile read()
WyalFile from the token stream. If the stream is
invalid in some way (e.g. contains a syntax error, etc) then a
SyntaxError is thrown.protected WyalFile.Declaration parseAssertDeclaration(WyalFile parent)
assert declaration in a WyAL source file.wf - The WyAL file in which this declaration is defined.protected WyalFile.Declaration parseTypeDeclaration(WyalFile parent)
type declaration in a WyAL source file.wf - The WyAL file in which this declaration is defined.protected WyalFile.Declaration parseFunctionDeclaration(WyalFile parent)
protected WyalFile.Declaration parseMacroDeclaration(WyalFile parent)
public WyalFile.Type parseDefiniteType(WyalFileParser.EnclosingScope scope)
scope - The enclosing scope for this expression. This identifies any
generic arguments which are in scope, and also allocated each
variable in scope to its location index.public WyalFile.Type parseType(WyalFileParser.EnclosingScope scope)
TupleType ::= Type (',' Type)*
scope - The enclosing scope for this expression. This identifies any
generic arguments which are in scope, and also allocated each
variable in scope to its location index.wyc.lang.SyntacticType.TupleCopyright © 2017. All rights reserved.