head	1.1;
access;
symbols
	tcllib-1-13:1.1;
locks; strict;
comment	@# @;


1.1
date	2010.03.26.05.07.25;	author andreas_kupries;	state Exp;
branches;
next	;


desc
@@


1.1
log
@
	* New module, 'pt' for ParserTools. Requires Tcl 8.5. Supercedes
	  grammar_peg, grammar_me, and page.
@
text
@pt::grammar::peg {
    rules {
	AddOp      {is {/ {t -} {t +}}                                                                mode value}
	Digit      {is {/ {t 0} {t 1} {t 2} {t 3} {t 4} {t 5} {t 6} {t 7} {t 8} {t 9}}                mode value}
	Expression {is {/ {x {t (} {n Expression} {t )}} {x {n Factor} {* {x {n MulOp} {n Factor}}}}} mode value}
	Factor     {is {x {n Term} {* {x {n AddOp} {n Term}}}}                                        mode value}
	MulOp      {is {/ {t *} {t /}}                                                                mode value}
	Number     {is {x {? {n Sign}} {+ {n Digit}}}                                                 mode value}
	Sign       {is {/ {t -} {t +}}                                                                mode value}
	Term       {is {n Number}                                                                     mode value}
    }
    start {n Expression}
}
@
