incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Incubator Wiki] Update of "GrammarProposal" by gaellalire
Date Thu, 19 Nov 2009 01:19:07 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Incubator Wiki" for change notification.

The "GrammarProposal" page has been changed by gaellalire.
http://wiki.apache.org/incubator/GrammarProposal?action=diff&rev1=1&rev2=2

--------------------------------------------------

  Grammar is a pure java syntax analyzer library.
  
  = Proposal =
- TODO
+ Grammar library can be use with a simple maven dependency.
+ Grammar are defined with terminals, non-terminals and rules.
+ For example an expression is a non-terminal, a number is a terminal and a rule is
+ 'expression -> expression + number'.
+ You write the rule content in a java file, and you can attach some data to terminals, non-terminals.
+ Data attached to terminals are provided by some lexer, whereas data attached to non-terminals
are generated
+ using a method attached to rule.
+ All terminals, non-terminals and rules are java object you will give to one of provided
grammars.
  
  == Background ==
- TODO
+ Most of java compilation tools ask to define your grammar is a special file.
+ Then you will run the tool on this special file and you will obtain a java source file.
+ Usually the special file contains some piece of pseudo java code (with special token like
$n to access to
+ information attached to the n token of the rule).
+ However SableCC propose another approach : no pseudo java code in special file, you will
complete generated
+ files after. I think that this approach is cleaner.
  
  === Rationale ===
- TODO
+ Because of pre-compilation grammar are not enough use in refractor tools or analyze tools,
we prefer to use regular expression.
+ Regular expression are very powerful however they becomes really difficult to understand
and maintain when we want to recognize
+ some complex informations.
  
- == Initial Goals ==
- TODO
+ With a dynamically generated grammar I think refractor tools or analyze tools could be enhanced
(if the tools provide you predefined
+ terminals and ask you to define what you need to recognize).
+ 
+ Moreover dynamically generated grammar allow some rules reusability. For example (if then
else), (while), (for) can be part of grammar
+ reusable from one language to another. The condition to allow the reusability is to accept
different terminals for block start (a '{' in java
+ or 'then' in lua), block stop ...
+ We can also share grammar construction for boolean or arithmetic expressions.
+ 
+ With dynamically generated we can also imagine dynamically grammar transformer, for example
the end user decide if he want multiplication
+ having higher priority than addition or not then the grammar is generated (without pre-compilation
issues).
+ 
+ In last, the code is not so hard to understand. Java brings Set, List and Map implementations
and they are widely use to perform grammar automate construction.
  
  == Current Status ==
- TODO
+ Look for a community.
  
  === Meritocracy ===
  TODO
  
  === Community ===
- TODO
+ A single developer.
  
  === Core Developers ===
- TODO
+ Gael Lalire starts to write the code.
  
  === Alignment ===
- TODO
+ Apache provide widely used utilities, this project may add a missing utility.
  
  == Known Risks ==
- TODO
  
  === Orphaned Projects ===
- TODO
+ Because there is only one committer, there is a risk of being orphaned.
  
  === Inexperience With Open Source ===
- TODO
+ TODO 
  
  === Reliance On Salaried Developers ===
- TODO
+ The project development occurs in volunteer time. No corporations is sponsoring it. 
  
  === Relationships with Other Apache Products ===
- TODO
+ As an utility project, grammar should not have many dependencies. In initial code there
is no dependency (only JDK 5 classes).
+ Grammar could use Log4J.
  
  == Initial Source ==
+ A source code was sent on general incubator mailing-list
- TODO
- 
- === External Dependencies ===
- TODO
- 
- === Cryptography ===
- TODO
  
  = Required Resources =
+ Mailing lists, Subversion Directory and Issue Tracking if this project should be a TLP.
+ However commons project could be the right place for such project. 
- Mailing lists: 
- TODO
- 
- Subversion Directory:
- TODO
- 
- Issue Tracking: 
- TODO
- 
- Other Resources:
- TODO
  
  == Initial Committers ==
- TODO
+ Gael Lalire (gael dot lalire at gmail dot com)
  
  = Sponsors =
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message