# Module epp_dodger

`epp_dodger` - bypasses the Erlang preprocessor.

- Description
- Function Index
- Function Details

## Description

`epp_dodger` - bypasses the Erlang preprocessor.

This module tokenises and parses most Erlang source code without expanding preprocessor directives and macro applications, as long as these are syntactically "well-behaved". Because the normal parse trees of the `erl_parse` module cannot represent these things (normally, they are expanded by the Erlang preprocessor "`epp`" before the parser sees them), an extended syntax tree is created, using the `erl_syntax` module.

## Function Index

format_error/1 | Callback function for formatting error descriptors.
parse/1 | Equivalent to `parse(IODevice, 1)`.
parse/2 | Reads and parses program text from an I/O stream.
parse_file/1 | Reads and parses a file.
parse_form/2 | Reads and parses a single program form from an I/O stream.
quick_parse/1 |
quick_parse/2 |
quick_parse_file/1 |
quick_parse_form/2 |

## Function Details

### format_error/1

`format_error(X1::term()) -> string()`

Callback function for formatting error descriptors.

### parse/1

`parse(Dev::IODevice) -> {ok, Forms} | {error, ErrorInfo}`

Equivalent to `parse(IODevice, 1)`.

### parse/2

`parse(Dev::IODevice, L0::StartLine) -> {ok, Forms} | {error, ErrorInfo}`

- `IODevice = pid()`
- `StartLine = integer()`
- `Forms = [erl_syntax:syntaxTree()]`
- `ErrorInfo = term()`

Reads and parses program text from an I/O stream. Characters are read from `IODevice` until end-of-file; apart from this, the behaviour is the same as for `parse_file/1`. `StartLine` is the initial line number, which should be a positive integer.

See also: parse_file/1.

### parse_file/1

`parse_file(File) -> {ok, Forms} | {error, ErrorInfo}`

- `File = file:filename()`
- `Forms = [erl_syntax:syntaxTree()]`
- `ErrorInfo = term()`

Reads and parses a file. If successful, `{ok, Forms}` is returned, where `Forms` is a list of abstract syntax trees representing the "program forms" of the file (cf. `erl_syntax:is_form/1`). Otherwise, `{error, ErrorInfo}` is returned, where `ErrorInfo` is an Erlang I/O ErrorInfo structure (see module `io`.)

See also: io, erl_syntax:is_form/1.

### parse_form/2

`parse_form(Dev::IODevice, L0::StartLine) -> {ok, Form, LineNo} | {eof, LineNo} | {error, ErrorInfo, LineNo}`

- `IODevice = pid()`
- `StartLine = integer()`
- `Form = erl_syntax:syntaxTree() | none`
- `ErrorInfo = term()`
- `LineNo = integer()`

Reads and parses a single program form from an I/O stream. Characters are read from `IODevice` until an end-of-form marker is found (a period character followed by whitespace), or until end-of-file; apart from this, the behaviour is similar to that of `parse/2`, except that the return values also contain the final line number, given that `StartLine` is the initial line number, and that `{eof, LineNo}` may be returned. If the scanning/parsing determines that the form should be discarded, `{ok, none, LineNo}` will be returned.

See also: parse/2.

### quick_parse/1

`quick_parse(Dev) -> term()`

### quick_parse/2

`quick_parse(Dev, L0) -> term()`

### quick_parse_file/1

`quick_parse_file(File) -> term()`

### quick_parse_form/2

`quick_parse_form(Dev, L0) -> term()`