org.quasiliteral.text
Class EYaccFixer

java.lang.Object
  |
  +--org.quasiliteral.text.EYaccFixer

public class EYaccFixer
extends Object

Untamed: Post-processes the output of byacc/Java (Berkeley Yacc for Java) so that it is valid Java.

The problem with byacc/Java's output is simply that it's too large. Specifically, Java turns the table initializers into bytecodes to perform the initialization. These bytecodes exceed Java's limit of 64KB per method. To work around this, EYaccFixer parses the table initializations, serializes the resulting tables into a file to be included as a resource in the e.jar file, and changes the table initializations to initialize these tables by unserializing these resources.

Author:
Mark S. Miller

Field Summary
private static ValueMaker ParseQExpr
           
private static MatchMaker ParseQPatt
           
private static SimpleQuasiParser QParser
           
private static String rName
           
 
Constructor Summary
EYaccFixer()
          Enabled:
 
Method Summary
static long checkhash(short[] yytable, short[] yycheck)
          Enabled: Used to make sure that the tables read in to the transformed parser are the same as the tables extracted from the pre-transformed parser.
private static short[] eatMyShorts(String numbers)
           
static void main(String[] args)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QParser

private static final SimpleQuasiParser QParser

ParseQPatt

private static final MatchMaker ParseQPatt

rName

private static final String rName

ParseQExpr

private static final ValueMaker ParseQExpr
Constructor Detail

EYaccFixer

public EYaccFixer()
Enabled:

Method Detail

checkhash

public static long checkhash(short[] yytable,
                             short[] yycheck)
Enabled: Used to make sure that the tables read in to the transformed parser are the same as the tables extracted from the pre-transformed parser. Ideally, this should be a hash function that's good at detecting errors, like a CRC. But for now we just do something crude.


eatMyShorts

private static short[] eatMyShorts(String numbers)

main

public static void main(String[] args)
                 throws IOException
Enabled:

IOException


comments?