Browsing projects by Tag(s)

Select a tag to browse associated projects and drill deeper into the tag cloud.

Showing page 1 of 1

Grammar Extractors is a suite of scripts useful for extracting grammar descriptions from Yacc, Yapp and Bison input files. The output should be suitable for later processing via other utilities.

0
 
  0 reviews  |  0 users  |  2,973 lines of code  |  0 current contributors  |  Analyzed 4 days ago
 
 

Synopsislemon2yapp.pl < input.y > output.yp DescriptionLemon is a parser generator maintained as part of the SQLite project. This perl script takes a lemon grammar file on stdin (input.y) and prints out an equivalent grammar file suitable for use with the Parse::Yapp perl parser generator ... [More] module (output.yp). This output can be used with the yapp command line tool to produce a perl parser for the grammar. The output is also good for making a skeletal grammar file for use with yacc, as yapp and yacc have pretty much the same grammar file format. DependenciesTo use this script to simply produce a yapp grammar file, all you will need is perl (version > 5). However, in order to generate your perl parser from this grammar file you will need the Parse::Yapp perl module. You can get it from CPAN by doing something like perl -MCPAN -e 'install Parse::Yapp'. Optionally, if you wish to build the script from source you will also need make. And finally, you will need some sort of unixy operating system with a shell. Note:If your perl executable is not located at /usr/bin/perl then you will need to edit the prebuilt script (or the Makefile if you are building the script from source) to reflect the correct path. Incidentally, if you make this stuff work with Windows or something, please describe what you did in the wiki about it so that others can benefit. Thanks! CaveatsThis script makes no attempt to do anything with rule actions---it simply removes them. Same goes for comments in the source file. Also, the %fallback directive is not understood by yapp, so it is ignored, as are the %ifdef / %ifndef directives. In fact, the only directives used by this script are the precedence directives (%left, %right, etc.) The best thing to do is to scan the source file and manually extract anything inside an %ifdef / %ifndef block that you don't want, as everything else will be put into the output. Then you can manually define an nonterminal that does what the %fallback directive would have done. Build and Installation NotesThe prebuilt perl script is available in the downloads section, but if you wish to build it from the source you may use the provided Makefile. Just copy the lemon2yapp.yp and Makefile files to an empty directory, and then run make. It will produce the lemon2yapp.pl script for you. See AlsoRunning yapp -h will produce usage info for the yapp tool. The perldoc provided with the Parse::Yapp module describe its minor deviations from the yacc standard grammar file format. The best reference for the lemon grammar file format is on the main lemon site and in the source lemon.c file itself. [Less]

0
 
  0 reviews  |  0 users  |  1,066 lines of code  |  0 current contributors  |  Analyzed 5 days ago
 
 

CORBA::IDL - Parser IDL This distribution supplies parsers for the language CORBA IDL (Interface Definition Language). The followed versions are implemented : CORBA 2.0, 2.1, 2.2, 2.3, 2.4 & 3.0 The parsers are generated by Parse::Yapp. The Visitor design pattern is used in this Perl ... [More] OO application. The visitor ascii.pm is not a real application, just a sample. Others visitors are available (CORBA::C, CORBA::HTML) or implementable. [Less]

0
 
  0 reviews  |  0 users  |  49,522 lines of code  |  0 current contributors  |  Analyzed 6 days ago
 
 

Parse::EyappCasiano Rodriguez-Leon Dpto. Estadistica, I.O. y Computacion. Universidad de La Laguna Abstract:Parse::Eyapp (Extended yapp) is a collection of modules that extends Francois Desarmenien Parse::Yapp 1.05. Eyapp extends yacc/yapp syntax with functionalities like named attributes ... [More] , EBNF-like expressions, modifiable default action, automatic abstract syntax tree building, dynamic conflict resolution, translation schemes, tree regular expressions, tree transformations, scope analysis support, and directed acyclic graphs among others. This article teaches you the basics of Compiler Construction using Parse::Eyapp to build a translator from infix expressions to Parrot Intermediate Representation. Introduction A Fast Introduction to Parrot The Phases of a Translator Lexical Analysis Syntax Analysis Ambiguities and Conflicts Building the AST Tree Transformations Resource Allocation Code Generation Peephole Transformations Output Generation Conclusions and Future Work About the Author Acknowledgements Bibliography [Less]

0
 
  0 reviews  |  0 users  |  26,663 lines of code  |  0 current contributors  |  Analyzed 7 days ago
 
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.