Metalua
Static meta-programming for Lua
Home page
Quick tour
Manual
Blog
Download
Mailing list
Lua.org
Lua wiki
Download PDF version
Table of contents
Metalua Manual
Table of Contents
Chapter 1 meta-programming
1.1 Concepts
1.2 Metalua extensions
1.2.1 Anonymous functions
1.2.2 Functions as infix operators
1.2.3 Algebraic datataypes
1.2.4 Metalevel shifters
1.3 Data structures
1.3.1 Algebraic Datatypes (ADT)
1.3.2 Abstract Syntax Trees (AST)
1.3.3 AST
мо
Lua source translation
1.4 Splicing and quoting
1.4.1 Quasi-quoting
1.4.2 Splicing
1.4.3 A couple of simple concrete examples
Chapter 2 meta-libraries
2.1
gg
, the grammar generator
2.1.1 Sequences
2.1.2 Sequence sets
2.1.3 List parser
2.1.4 Method
.separators:add
2.1.5 Method
.terminators:add
2.1.6 Expression parser
2.1.7
onkeyword
parser
2.1.8
optkeyword
parser
2.2
mlp
, the metalua parser
2.2.1 Parsing expressions
2.2.2 Parsing statements
2.2.3 Other useful functions and variables
2.3 Extension
match
: structural pattern matching
2.3.1 Purpose
2.3.2 Patterns definition
2.3.3 Examples
2.4
walk
, the code walker
2.4.1 Principles
2.4.2 API
2.4.3 Examples
2.4.4 Library
walk.id
, the scope-aware walker
2.4.5 Library
walk.scope
, the scope helper
2.5 Dollar extension
Chapter 3 generic libraries
3.1 Standard library
3.1.1 Base library extensions
3.1.2
table
extensions
3.1.3
string
extensions
3.1.4 Library
mlc
3.1.5 Library
walker
3.2
clopts
: command line options parsing
3.3
springs
: separate universes for Lua
3.3.1 Origins and purpose
3.3.2 API
3.4
clist
: Lists by comprehension
Chapter 4 Samples and tutorials
4.1 Advanced examples
4.1.1 Exceptions
4.1.2 Structural pattern matching
@.2 Digging in the sources
@.2.1 gg
@.2.2 lexer, mlp_lexer
@.2.3 mlp
@.2.4 Bytecode generation
@.2.5 The bootstrapping process
@.3 Abstract Syntax Tree grammar