newBNF {xegaBNF}R Documentation

Convert grammar file into a constant function.

Description

newBNF() reads a text file and returns a constant function which returns the BNF as a character string.

Usage

newBNF(filename, eol = "\n")

Arguments

filename

A file name.

eol

End-of-line symbol(s). Default: "\n"

Details

The purpose of this function is to include examples of grammars in packages.

Value

Returns a constant function which returns a BNF.

See Also

Other File I/O: readBNF(), writeBNF()

Examples

g<-booleanGrammar()
fn<-tempfile()
writeBNF(g, fn)
g1<-newBNF(fn)
unlink(fn)

[Package xegaBNF version 1.0.0.0 Index]