Farkle


EGT Module

Functions to read and write grammars from EGT files. Grammars can be read either from GOLD Parser's Enhanced Grammar Tables (version 5.0) or from Farkle's EGTneo format. EGTneo (new encoding option) is a file format designed for Farkle that is more compact and easier to read. GOLD Parser cannot read EGTneo files. Grammars can only be written in the EGTneo format.

Functions and values

Function or value Description

ofBase64String str

Full Usage: ofBase64String str

Parameters:
    str : string

Returns: Grammar

Reads a `Grammar` from a Base64-encoded string.

str : string
Returns: Grammar

ofFile path

Full Usage: ofFile path

Parameters:
    path : string

Returns: Grammar

Reads an EGT file from the file system and returns a `Grammar`.

path : string
Returns: Grammar

ofStream stream

Full Usage: ofStream stream

Parameters:
Returns: Grammar

Reads a `Grammar` from a stream.

stream : Stream
Returns: Grammar

toStreamNeo stream grammar

Full Usage: toStreamNeo stream grammar

Parameters:

Writes the given `Grammar` to a stream in the EGTneo format.

stream : Stream
grammar : Grammar