SmaCC question

Brian Murphy-Dye brian at murphydye.com
Mon Feb 18 23:18:51 UTC 2008


I'm trying to write a simple parser to copy input, but replacing some
text with html links. My problem is that I get this error even on
reduced scanner code:
    'A block compiles more than 1K bytes of code'

By removing 'Deuteronomy' from the scanner code below, things work
fine. Any suggestions would be much appreciated.

Brian.

-------------------- Parser Code

Text :
	Text Term
	| Term ;

Term :
	Reference
	| String
	| <integer> { Transcript show: '1' value asString } ;

Reference :
	BibleReference { Transcript show: '[', '1' first value asString, ']' } ;

	
String :
	( <word> | <spaces>  | <comma> | <period> | <dash> ) { Transcript
show: '1' value asString. };
	
BibleReference :
	<biblebook> ;


--------------------  Scanner Code

<integer>       :     \d+ ;
<period>        :      \.;
<dash>          :      -;
<comma>       :      ,;

<biblebook> : (Genesis | Gn | Gen | Exodus | Ex | Leviticus | Lv | Lev
| Nm | Num | Numbers | Dt | Deuteronomy) \.? \s+ \d+ (\: \d+ (-
\d+)?)? ;

<word>         :      [^\s\.,]+;
<spaces>        :      \s+;


-------------------- Test Code

Mttt 334 asdf Genesis hello Gn 3:2
Cf Gen 3 42 hm 1 Cor. 3 bloop



More information about the Squeak-dev mailing list