class Ven::Compiler
- Ven::Compiler
- Ven::Suite::Visitor(Nil)
- Reference
- Object
Overview
A quote visitor that produces Ven unstitched chunks.
Ven bytecode instructions (Instruction
) are organized
into snippets (Snippet
), which themselves are grouped
into chunks (Chunk
). It is the snippets' delimitation
that makes us call the chunks unstitched.
The boundaries between snippets are dissolved during the process of stitching. Once this process is finished, the chunks are thought of as stitched.
puts Compiler.compile(quotes) # ==> unstitched chunks
Included Modules
Defined in:
ven/compile.crConstructors
-
.new(file : String = "untitled", context : Ven::Suite::Context::Compiler = Context::Compiler.new, origin : Int32 = 0)
Makes a compiler.
Class Method Summary
-
.compile(quotes, file = "untitled", context = Context::Compiler.new, origin = 0)
Makes a compiler, compiles quotes with it and disposes the compiler.
Instance Method Summary
-
#visit(quote : QVoid)
Passes without returning anything.
-
#visit(quotes : Quotes)
Visits each quote of quotes.
- #visit!(q : QRuntimeSymbol)
- #visit!(q : QReadtimeSymbol)
- #visit!(q : QNumber)
- #visit!(q : QString)
- #visit!(q : QRegex)
- #visit!(q : QVector)
- #visit!(q : QUPop)
- #visit!(q : QURef)
- #visit!(q : QUnary)
- #visit!(q : QBinary)
- #visit!(q : QAssign)
- #visit!(q : QBinaryAssign)
- #visit!(q : QCall)
- #visit!(q : QDies)
- #visit!(q : QIntoBool)
- #visit!(q : QReturnIncrement)
- #visit!(q : QReturnDecrement)
- #visit!(q : QAccessField)
- #visit!(q : QReduceSpread)
- #visit!(q : QMapSpread)
- #visit!(q : QIf)
- #visit!(q : QBlock)
- #visit!(q : QGroup)
- #visit!(q : QEnsure)
- #visit!(q : QFun)
- #visit!(q : QInfiniteLoop)
- #visit!(q : QBaseLoop)
- #visit!(q : QStepLoop)
- #visit!(q : QComplexLoop)
- #visit!(q : QNext)
- #visit!(q : QReturnStatement | QReturnExpression)
- #visit!(q : QBox)
Instance methods inherited from class Ven::Suite::Visitor(Nil)
last=(last : Quote)
last=,
visit(quote : Quote)visit(quotes : Quotes) visit, visit!(quote : _) visit!
Constructor Detail
Makes a compiler.
No arguments are required, but file (for a file name), context (for a compiler context) and origin (for the point of origin of chunk emission) can be provided.
Class Method Detail
Makes a compiler, compiles quotes with it and disposes the compiler.
quotes are the quotes to-be-compiled; file is the filename under which they will be compiled; context is the compiler context of the compilation.
Returns unstitched chunks.