Diesel behaviour (diesel v0.5.4)
Declarative programming in Elixir
Diesel is a toolkit that helps you build your own DSLs.
Usage:
defmodule MyApp.Fsm do
use Diesel,
otp_app: :my_app,
dsl: MyApp.Fsm.Dsl,
parsers: [
...
],
generators: [
...
]
end
For more information on how to use this library, please check:
- the
Diesel.Dsl
andDiesel.Tag
modules, - the guides and tutorials provided in the documentation
- the examples used in tests
Summary
Callbacks
Compiles the raw definition and returns a compiled version of it
Returns the raw definition for the dsl, before compilation
Functions
Returns the first child of the given element, or list of elements
Returns the first child element matching the given name, from the given definition
Returns all children elements matching the given tag
Returns all elements matching the given name
Types
element()
tag()
@type tag() :: atom()
Callbacks
compile(context)
Compiles the raw definition and returns a compiled version of it
The obtained structure is the result of applying the configured list of parsers to the raw internal definition and then compiling it according to the rules implemented by packages.
definition()
@callback definition() :: element()
Returns the raw definition for the dsl, before compilation
Functions
child(nodes)
Returns the first child of the given element, or list of elements
child(element, name)
Returns the first child element matching the given name, from the given definition
children(arg, name)
Returns all children elements matching the given tag
elements(elements, name)
Returns all elements matching the given name