abstract class Ven::Parselet::Nud
- Ven::Parselet::Nud
- Reference
- Object
Overview
A parser that is invoked by a null-denotated token.
Direct Known Subclasses
- Ven::Parselet::PBlock
- Ven::Parselet::PEnsure
- Ven::Parselet::PExpose
- Ven::Parselet::PFun
- Ven::Parselet::PGroup
- Ven::Parselet::PIf
- Ven::Parselet::PLoop
- Ven::Parselet::PNext
- Ven::Parselet::PNudMacro
- Ven::Parselet::PNumber
- Ven::Parselet::PQueue
- Ven::Parselet::PRegex
- Ven::Parselet::PReturnExpression
- Ven::Parselet::PReturnStatement
- Ven::Parselet::PSpread
- Ven::Parselet::PString
- Ven::Parselet::PSymbol
- Ven::Parselet::PUnary
- Ven::Parselet::PUPop
- Ven::Parselet::PURef
- Ven::Parselet::PVector
Defined in:
ven/parselet/nud.crConstructors
-
.new(precedence : UInt8 = 0_u8)
Makes a nud with precedence precedence.
Instance Method Summary
-
#block(opening = true, semicolon : Bool = false)
Reads a block under the jurisdiction of this nud.
-
#die(message : String)
Dies of read error with message, which should explain why the error happened.
-
#led(precedence : Precedence)
Reads a led under the jurisdiction of this nud and with the precedence of this nud.
-
#led(precedence = @precedence)
Reads a led under the jurisdiction of this nud and with the precedence of this nud.
-
#parse(tag : QTag, token : Word)
Performs the parsing.
-
#parse!(parser : Ven::Reader, tag : QTag, token : Ven::Word)
Performs the parsing
-
#semicolon : Bool
Whether a semicolon must follow this nud.
-
#symbol(tag, token = nil) : QSymbol
Reads a symbol if token is nil (orelse uses the value of token) and creates the corresponding symbol quote.
Macro Summary
-
if?(word, then consequtive, else alternative = nil)
Evaluates consequtive if read word; otherwise, evaluates alternative.
-
lexeme(token = token)
Returns the lexeme of token.
-
type(token = token)
Returns the type of token.
Constructor Detail
Instance Method Detail
Reads a block under the jurisdiction of this nud. Returns the statements of this block. If opening is false, the opening paren won't be read.
Dies of read error with message, which should explain why the error happened.
Reads a led under the jurisdiction of this nud and with the precedence of this nud.
Reads a led under the jurisdiction of this nud and with the precedence of this nud.
Performs the parsing
Reads a symbol if token is nil (orelse uses the value of token) and creates the corresponding symbol quote.
Macro Detail
Evaluates consequtive if read word; otherwise, evaluates alternative.
Returns the lexeme of token.
token defaults to token
, which is the standard name
of the lead token in #parse
.