### Hierarchy

- Compiler

## Index

### Constructors

- constructor

### Properties

- fragmentsAfter
- fragmentsBefore
- rules

### Methods

- addFragment
- compile
- getRule
- prettyPrintError
- processTokens
- use

## Constructors

### constructor

- new Compiler(rules: RuleBook): Compiler

- - Defined in Compiler.ts:13

  #### Parameters

  - ##### rules: RuleBook

  #### Returns Compiler

## Properties

### Private fragmentsAfter

fragmentsAfter: FragmentCtr[] = []

- Defined in Compiler.ts:13

### Private fragmentsBefore

fragmentsBefore: FragmentCtr[] = []

- Defined in Compiler.ts:12

### Private rules

rules: RuleBook

- Defined in Compiler.ts:15

## Methods

### addFragment

- addFragment(position: "before" | "after", f: FragmentCtr): void

- - Defined in Compiler.ts:26

  #### Parameters

  - ##### position: "before" | "after"

  - ##### f: FragmentCtr

  #### Returns void

### compile

- compile(input: string, options: CompilerOptions): CodeWithSourceMap

- - Defined in Compiler.ts:34

  #### Parameters

  - ##### input: string

  - ##### options: CompilerOptions

  #### Returns CodeWithSourceMap

### Private getRule

- getRule(t: Token): Rule

- - Defined in Compiler.ts:105

  #### Parameters

  - ##### t: Token

  #### Returns Rule

### Private prettyPrintError

- prettyPrintError(e: CompileError, text: string, file: string): string

- - Defined in Compiler.ts:83

  #### Parameters

  - ##### e: CompileError

  - ##### text: string

  - ##### file: string

  #### Returns string

### processTokens

- processTokens(tokens: Token[], options: CompilerOptions): CodeWithSourceMap

- - Defined in Compiler.ts:52

  #### Parameters

  - ##### tokens: Token[]

  - ##### options: CompilerOptions

  #### Returns CodeWithSourceMap

### use

- use(rule: Rule): void

- - Defined in Compiler.ts:17

  #### Parameters

  - ##### rule: Rule

  #### Returns void

Generated using TypeDoc