org.quasiliteral.term
Class TermParser

java.lang.Object
  |
  +--org.quasiliteral.term.TermParser

public class TermParser
extends Object

Safe:


Field Summary
private  QuasiBuilder b
           
static AstroSchema DEFAULT_SCHEMA
          Enabled: Builds ASTs according to the term.y grammar
static short EOL
          Enabled:
static short EOTLU
          Enabled:
static short LiteralChar
          Enabled:
static short LiteralFloat64
          Enabled:
static short LiteralInteger
          Enabled:
static short LiteralString
          Enabled:
private  LexerFace myLexer
          contains all the tokens after yylval
private  Astro myOptResult
           
static short OpDef
          Enabled:
(package private)  int stateptr
           
(package private)  int[] statestk
           
static short Tag
          Enabled:
private static String[] TheTokens
           
(package private)  int valptr
           
(package private)  Object[] valstk
           
(package private)  int yychar
           
(package private) static short[] yycheck
           
(package private)  boolean yydebug
           
(package private) static short[] yydefred
           
(package private) static short[] yydgoto
           
static short YYERRCODE
          Enabled:
(package private)  int yyerrflag
           
(package private) static short YYFINAL
           
(package private) static short[] yygindex
           
(package private) static short[] yylen
           
(package private) static short[] yylhs
           
(package private)  Object yylval
           
(package private) static short YYMAXTOKEN
           
(package private) static String[] yyname
           
(package private)  int yynerrs
           
(package private) static short[] yyrindex
           
(package private) static String[] yyrule
           
(package private) static short[] yysindex
           
(package private) static int YYSTACKSIZE
           
(package private) static short[] yytable
           
(package private) static int YYTABLESIZE
           
(package private)  String yytext
           
(package private)  Object yyval
           
 
Constructor Summary
TermParser(LexerFace lexer, QuasiBuilder builder)
          Enabled:
 
Method Summary
(package private)  void debug(String msg)
           
(package private)  void dump_stacks(int count)
           
(package private)  boolean init_stacks()
           
 Astro parse()
          Enabled:
private  void reserved(String s)
           
static Term run(Twine source)
          Enabled: builder defaults to the quasi-adapted, non-quasi builder for building Term trees.
static Astro run(Twine source, QuasiBuilder builder)
          Enabled:
(package private)  void state_drop(int cnt)
           
(package private)  int state_peek(int relative)
           
(package private)  int state_pop()
           
(package private)  void state_push(int state)
           
private  Astro untag(Astro token)
          Transform '.Tag.("foo")' into 'foo'.
(package private)  void val_drop(int cnt)
           
(package private)  void val_init()
           
(package private)  Object val_peek(int relative)
           
(package private)  Object val_pop()
           
(package private)  void val_push(Object val)
           
private  void yyerror(String s)
           
private  short yylex()
          Skips EOLs and EOTLUs.
(package private)  void yylexdebug(int state, int ch)
           
(package private)  int yyparse()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

yydebug

boolean yydebug

yynerrs

int yynerrs

yyerrflag

int yyerrflag

yychar

int yychar

YYSTACKSIZE

static final int YYSTACKSIZE

statestk

int[] statestk

stateptr

int stateptr

yytext

String yytext

yyval

Object yyval

yylval

Object yylval

valstk

Object[] valstk

valptr

int valptr

Tag

public static final short Tag
Enabled:


LiteralChar

public static final short LiteralChar
Enabled:


LiteralInteger

public static final short LiteralInteger
Enabled:


LiteralFloat64

public static final short LiteralFloat64
Enabled:


LiteralString

public static final short LiteralString
Enabled:


EOL

public static final short EOL
Enabled:


EOTLU

public static final short EOTLU
Enabled:


OpDef

public static final short OpDef
Enabled:


YYERRCODE

public static final short YYERRCODE
Enabled:


yylhs

static final short[] yylhs

yylen

static final short[] yylen

yydefred

static final short[] yydefred

yydgoto

static final short[] yydgoto

yysindex

static final short[] yysindex

yyrindex

static final short[] yyrindex

yygindex

static final short[] yygindex

YYTABLESIZE

static final int YYTABLESIZE

yytable

static final short[] yytable

yycheck

static final short[] yycheck

YYFINAL

static final short YYFINAL

YYMAXTOKEN

static final short YYMAXTOKEN

yyname

static final String[] yyname

yyrule

static final String[] yyrule

myLexer

private final LexerFace myLexer
contains all the tokens after yylval


b

private final QuasiBuilder b

myOptResult

private Astro myOptResult

TheTokens

private static final String[] TheTokens

DEFAULT_SCHEMA

public static final AstroSchema DEFAULT_SCHEMA
Enabled: Builds ASTs according to the term.y grammar

Constructor Detail

TermParser

public TermParser(LexerFace lexer,
                  QuasiBuilder builder)
Enabled:

Method Detail

debug

void debug(String msg)

state_push

void state_push(int state)

state_pop

int state_pop()

state_drop

void state_drop(int cnt)

state_peek

int state_peek(int relative)

init_stacks

boolean init_stacks()

dump_stacks

void dump_stacks(int count)

val_init

void val_init()

val_push

void val_push(Object val)

val_pop

Object val_pop()

val_drop

void val_drop(int cnt)

val_peek

Object val_peek(int relative)

run

public static Term run(Twine source)
Enabled: builder defaults to the quasi-adapted, non-quasi builder for building Term trees.


run

public static Astro run(Twine source,
                        QuasiBuilder builder)
Enabled:


parse

public Astro parse()
Enabled:


yylex

private short yylex()
Skips EOLs and EOTLUs.

Note that yacc uses tag-codes, while Antlr uses type-codes.


reserved

private void reserved(String s)
               throws SyntaxException
SyntaxException

yyerror

private void yyerror(String s)
              throws SyntaxException
SyntaxException

untag

private Astro untag(Astro token)
Transform '.Tag.("foo")' into 'foo'.

Otherwise, is an identity function. This is needed for the TermParser specifically, since identifiers in the input must all be of token tag-name .Tag., while each of these represents a unique keyword, and therefore token-tag, in the grammar being described.


yylexdebug

void yylexdebug(int state,
                int ch)

yyparse

int yyparse()


comments?