newBNF: Convert grammar file into a constant function.

View source: R/BNFfileIO.R

newBNFR 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)

xegaBNF documentation built on May 29, 2024, 10:23 a.m.

Related to newBNF in xegaBNF...