Public Member Functions | Public Attributes | List of all members
moot::mootClassfreqsCompiler Class Reference

Lexical-class frequency parameter-file compiler. More...

Inheritance diagram for moot::mootClassfreqsCompiler:
Inheritance graph
[legend]
Collaboration diagram for moot::mootClassfreqsCompiler:
Collaboration graph
[legend]

Public Member Functions

 mootClassfreqsCompiler ()
 
virtual ~mootClassfreqsCompiler ()
 
mootClassfreqsparse_from_file (FILE *file, const char *filename=__null)
 
mootClassfreqsparse_from_string (const char *string, const char *srcname=__null)
 
void select_streams (FILE *in, FILE *out, const char *my_srcname=__null)
 
void select_string (const char *in, const char *my_srcname=__null)
 
virtual int yylex ()
 
mootClassfreqsparse_classfreqs ()
 
virtual void yyerror (const char *msg)
 
virtual void yywarn (const char *msg)
 
- Public Member Functions inherited from mootClassfreqsParser
int yyparse (void)
 
 mootClassfreqsParser ()
 
virtual ~mootClassfreqsParser (void)
 
virtual void yycarp (const char *fmt,...)
 

Public Attributes

mootClassfreqsLexer theLexer
 
const char * objname
 
const char * srcname
 
- Public Attributes inherited from mootClassfreqsParser
yy_mootClassfreqsParser_stype yylval
 
mootClassfreqsParserLType yylloc
 
int yynerrs
 
int yychar
 
int yydebug
 
moot::mootClassfreqscfreqs
 

Additional Inherited Members

- Static Public Attributes inherited from mootClassfreqsParser
static const int TAG
 
static const int COUNT
 
- Protected Attributes inherited from mootClassfreqsParser
moot::mootClassfreqs::LexClass lclass
 

Detailed Description

mootClassfreqsCompiler compiles lexical-class frequency parameter files into internal frequency tables, using a lexer/parser pair generated by Alain Coetmeur's flex++ and bison++ programs.

Constructor & Destructor Documentation

◆ mootClassfreqsCompiler()

moot::mootClassfreqsCompiler::mootClassfreqsCompiler ( )
inline

Default constructor

◆ ~mootClassfreqsCompiler()

virtual moot::mootClassfreqsCompiler::~mootClassfreqsCompiler ( )
inlinevirtual

Default destructor

Member Function Documentation

◆ parse_from_file()

mootClassfreqs* moot::mootClassfreqsCompiler::parse_from_file ( FILE *  file,
const char *  filename = __null 
)
inline

parse n-gram parameters from a C-stream. Returns NULL on error.

References parse_classfreqs(), and select_streams().

◆ parse_from_string()

mootClassfreqs* moot::mootClassfreqsCompiler::parse_from_string ( const char *  string,
const char *  srcname = __null 
)
inline

parse one regular expression from a C-string. Returns NULL on error.

References parse_classfreqs(), and select_string().

◆ select_streams()

void moot::mootClassfreqsCompiler::select_streams ( FILE *  in,
FILE *  out,
const char *  my_srcname = __null 
)
inline

low-level input selection: input from a C-stream.

References moot::GenericLexer::select_streams().

Referenced by parse_from_file().

◆ select_string()

void moot::mootClassfreqsCompiler::select_string ( const char *  in,
const char *  my_srcname = __null 
)
inline

low-level input selection: input from a C-string. WARNING: do NOT free the string 'in' until parsing has finished!

References parse_classfreqs(), moot::GenericLexer::select_string(), yyerror(), yylex(), and yywarn().

Referenced by parse_from_string().

◆ yylex()

virtual int moot::mootClassfreqsCompiler::yylex ( )
virtual

Implements mootClassfreqsParser.

Referenced by select_string().

◆ parse_classfreqs()

mootClassfreqs* moot::mootClassfreqsCompiler::parse_classfreqs ( )

low-level parsing method: parse all remaining n-grams from the currently selected input source.

Referenced by parse_from_file(), parse_from_string(), and select_string().

◆ yyerror()

virtual void moot::mootClassfreqsCompiler::yyerror ( const char *  msg)
virtual

yyerror: report parse errors.

Reimplemented from mootClassfreqsParser.

Referenced by select_string().

◆ yywarn()

virtual void moot::mootClassfreqsCompiler::yywarn ( const char *  msg)
virtual

yywarn: report parse warnings.

Reimplemented from mootClassfreqsParser.

Referenced by select_string().

Member Data Documentation

◆ theLexer

mootClassfreqsLexer moot::mootClassfreqsCompiler::theLexer

flex++ lexer object

◆ objname

const char* moot::mootClassfreqsCompiler::objname

objname: name to use for object when reporting errors – default: "mootClassfreqsCompiler" Warning: no copying is performed on this string; you must alloc&free it yourself!

◆ srcname

const char* moot::mootClassfreqsCompiler::srcname

srcname: name to use for current file when reporting errors – default: "(unknown)" Warning: no copying is performed on this string; you must alloc&free it yourself!


The documentation for this class was generated from the following file: