Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Parse::Yapp 1.05

    Download button

    No screenshots available
    Downloads: 364  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.4/5)
    5 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Francois Desarmenien | More programs
    Perl Artistic License / FREE
    January 10th, 2008, 02:18 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Parse::Yapp description

    Parse::Yapp is a Perl extension for generating and using LALR parsers.

    Parse::Yapp is a Perl extension for generating and using LALR parsers.

    SYNOPSIS

    yapp -m MyParser grammar_file.yp

    ...

    use MyParser;

    $parser=new MyParser();
    $value=$parser->YYParse(yylex => &lexer_sub, yyerror => &error_sub);

    $nberr=$parser->YYNberr();

    $parser->YYData->{DATA}= [ 'Anything', 'You Want' ];

    $data=$parser->YYData->{DATA}[0];

    Parse::Yapp (Yet Another Perl Parser compiler) is a collection of modules that let you generate and use yacc like thread safe (reentrant) parsers with perl object oriented interface.

    The script yapp is a front-end to the Parse::Yapp module and let you easily create a Perl OO parser from an input grammar file.

    The Grammar file

    Comments

    Through all your files, comments are either Perl style, introduced by # up to the end of line, or C style, enclosed between /* and */.

    Tokens and string literals

    Through all the grammar files, two kind of symbols may appear: Non-terminal symbols, called also left-hand-side symbols, which are the names of your rules, and Terminal symbols, called also Tokens.

    Tokens are the symbols your lexer function will feed your parser with (see below). They are of two flavours: symbolic tokens and string literals.
    Non-terminals and symbolic tokens share the same identifier syntax:

    [A-Za-z][A-Za-z0-9_]*

    String literals are enclosed in single quotes and can contain almost anything. They will be output to your parser file double-quoted, making any special character as such. '"', '$' and '@' will be automatically quoted with '', making their writing more natural. On the other hand, if you need a single quote inside your literal, just quote it with ''.

    You cannot have a literal 'error' in your grammar as it would confuse the driver with the error token. Use a symbolic token instead. In case you inadvertently use it, this will produce a warning telling you you should have written it error and will treat it as if it were the error token, which is certainly NOT what you meant.

    Grammar file syntax

    It is very close to yacc syntax (in fact, Parse::Yapp should compile a clean yacc grammar without any modification, whereas the opposite is not true).

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    LALR parsers | parser generator | Perl module | LALR | parser | generator

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM