Parsers::SimpleCalcYYLexer
use Parsers::SimpleCalcYYLexer;
use Parsers::SimpleCalcYYLexer qw(:all);
SimpleCalcYYLexer class provides the following methods:
new, YYLex, GetYYLex, StringifySimpleCalcYYLexer
Parser::SimpleCalcYYLexer class is derived from Parser::YYLexer class, which in turn is derived from base class Parser::Lexer that provides all the underlying lexer functionality. SimpleCalcYYLexer class is designed to be used with yyparse code generated by running byacc on a parser defined using parser definition SimpleCalcParser.yy file.
The parser package and token table files, SimpleCalcParser.pm and SimpleCalcParser.tab.ph, are automatically generated from parser grammar definition file, SimpleCalcParser.yy, using byacc available through perl-byacc1.8 modified with perl5-byacc-patches-0.5 for generation of object oriented parser:
SimpleCalcYYLexer.pm class implements a lexer for a simple calculator and is provided to highlight usasge of YYLex through yyparse.
The default specification of lexer tokens for SimpleCalcYYLexer.pm includes:
The default SimpleCalcParser.tab.ph file containing token identifiers for SimpleCalcParser.yy includes:
Using specified Input, new method generates a new SimpleCalcYYLexer and returns a reference to newly created SimpleCalcYYLexer object.
Examples:
Returns a string containing information about YYLexer object.
Lexer.pm, YYLexer.pm, SimpleCalcParser.yy
Copyright (C) 2024 Manish Sud. All rights reserved.
This file is part of MayaChemTools.
MayaChemTools is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.