org.quasiliteral.term
Class QuasiBuilderAdaptor

java.lang.Object
  |
  +--org.quasiliteral.term.QuasiBuilderAdaptor
All Implemented Interfaces:
AstroBuilder, QuasiBuilder

public class QuasiBuilderAdaptor
extends Object
implements QuasiBuilder

Untamed: Wraps an AstroBuilder to pretend to be of type QuasiBuilder.

This kludge exists only until we switch to Antlr, and make use of its support for grammar inheritance. Until then, the one grammar, term.y, must support both literal and quasi-literal term trees, so it is therefore defined in terms of the larger subtype -- QuasiBuilder.

Author:
Mark S. Miller

Field Summary
static QuasiBuilder FOR_TERMS
          Enabled: Builds Term trees according to the term.y grammar
private  AstroBuilder myBuilder
           
 
Constructor Summary
QuasiBuilderAdaptor(AstroBuilder builder)
          Enabled:
 
Method Summary
 Astro atHole(Astro litInt)
          Enabled:
 Astro bag(Object args)
          Enabled:
 AstroArg choice(AstroArg leftArg, AstroArg rightArg)
          Enabled:
 Astro composite(AstroTag tag, Object data, SourceSpan optSpan)
          Enabled:
 boolean doesQuasis()
          Enabled:
 Astro dollarHole(Astro litInt)
          Enabled:
 AstroSchema getSchema()
          Enabled:
 AstroArg group(Object args)
          Enabled:
 AstroArg interleave(AstroArg leftArg, AstroArg rightArg)
          Enabled:
 Astro leafChar(char data, SourceSpan optSpan)
          Enabled:
 Astro leafData(Object data, SourceSpan optSpan)
          Enabled:
 Astro leafFloat64(double data, SourceSpan optSpan)
          Enabled:
 Astro leafInteger(BigInteger data, SourceSpan optSpan)
          Enabled:
 Astro leafLong(long data, SourceSpan optSpan)
          Enabled:
 Astro leafString(String data, SourceSpan optSpan)
          Enabled:
 Astro leafTag(AstroTag tag, SourceSpan optSource)
          Enabled:
 Astro leafTwine(Twine data, SourceSpan optSpan)
          Enabled:
 Object list()
          Enabled:
 Object list(AstroArg first)
          Enabled:
 Object list(AstroArg first, AstroArg second)
          Enabled:
 Object list(AstroArg first, AstroArg second, AstroArg third)
          Enabled:
 Object list(AstroArg first, AstroArg second, AstroArg third, AstroArg fourth)
          Enabled:
 AstroArg some(AstroArg optSub, String quant)
          Enabled:
 Astro start(Astro top)
          Enabled:
 Astro taggedHole(Astro ident, Astro functorHole)
          Enabled:
 Astro term(Astro functor)
          Enabled:
 Astro term(Astro functor, Object args)
          Enabled:
 String toString()
          Suppressed:
 Astro tuple(Object args)
          Enabled:
 Object unpack(Astro litString)
          Enabled:
 Object with(Object list, AstroArg next)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FOR_TERMS

public static final QuasiBuilder FOR_TERMS
Enabled: Builds Term trees according to the term.y grammar


myBuilder

private final AstroBuilder myBuilder
Constructor Detail

QuasiBuilderAdaptor

public QuasiBuilderAdaptor(AstroBuilder builder)
Enabled:

Method Detail

toString

public String toString()
Suppressed:

Overrides:
toString in class Object
Returns:
a string representation of the object.

getSchema

public AstroSchema getSchema()
Enabled:

Specified by:
getSchema in interface AstroBuilder

start

public Astro start(Astro top)
Enabled:

Specified by:
start in interface AstroBuilder

leafTag

public Astro leafTag(AstroTag tag,
                     SourceSpan optSource)
Enabled:

Specified by:
leafTag in interface AstroBuilder

composite

public Astro composite(AstroTag tag,
                       Object data,
                       SourceSpan optSpan)
Enabled:

Specified by:
composite in interface AstroBuilder

leafData

public Astro leafData(Object data,
                      SourceSpan optSpan)
Enabled:

Specified by:
leafData in interface AstroBuilder

leafChar

public Astro leafChar(char data,
                      SourceSpan optSpan)
Enabled:

Specified by:
leafChar in interface AstroBuilder

leafLong

public Astro leafLong(long data,
                      SourceSpan optSpan)
Enabled:

Specified by:
leafLong in interface AstroBuilder

leafInteger

public Astro leafInteger(BigInteger data,
                         SourceSpan optSpan)
Enabled:

Specified by:
leafInteger in interface AstroBuilder

leafFloat64

public Astro leafFloat64(double data,
                         SourceSpan optSpan)
Enabled:

Specified by:
leafFloat64 in interface AstroBuilder

leafString

public Astro leafString(String data,
                        SourceSpan optSpan)
Enabled:

Specified by:
leafString in interface AstroBuilder

leafTwine

public Astro leafTwine(Twine data,
                       SourceSpan optSpan)
Enabled:

Specified by:
leafTwine in interface AstroBuilder

term

public Astro term(Astro functor,
                  Object args)
Enabled:

Specified by:
term in interface AstroBuilder
Parameters:
args - :Args

term

public Astro term(Astro functor)
Enabled:

Specified by:
term in interface AstroBuilder

tuple

public Astro tuple(Object args)
Enabled:

Specified by:
tuple in interface AstroBuilder

bag

public Astro bag(Object args)
Enabled:

Specified by:
bag in interface AstroBuilder

list

public Object list()
Enabled:

Specified by:
list in interface AstroBuilder
Returns:
:Args

list

public Object list(AstroArg first)
Enabled:

Specified by:
list in interface AstroBuilder
Returns:
:Args

list

public Object list(AstroArg first,
                   AstroArg second)
Enabled:

Specified by:
list in interface AstroBuilder

list

public Object list(AstroArg first,
                   AstroArg second,
                   AstroArg third)
Enabled:

Specified by:
list in interface AstroBuilder

list

public Object list(AstroArg first,
                   AstroArg second,
                   AstroArg third,
                   AstroArg fourth)
Enabled:

Specified by:
list in interface AstroBuilder

with

public Object with(Object list,
                   AstroArg next)
Enabled:

Specified by:
with in interface AstroBuilder
Parameters:
list - :Args
Returns:
:Args

unpack

public Object unpack(Astro litString)
Enabled:

Specified by:
unpack in interface AstroBuilder
Returns:
:Args

doesQuasis

public boolean doesQuasis()
Enabled:

Specified by:
doesQuasis in interface QuasiBuilder

taggedHole

public Astro taggedHole(Astro ident,
                        Astro functorHole)
Enabled:

Specified by:
taggedHole in interface QuasiBuilder

choice

public AstroArg choice(AstroArg leftArg,
                       AstroArg rightArg)
Enabled:

Specified by:
choice in interface QuasiBuilder

interleave

public AstroArg interleave(AstroArg leftArg,
                           AstroArg rightArg)
Enabled:

Specified by:
interleave in interface QuasiBuilder

some

public AstroArg some(AstroArg optSub,
                     String quant)
Enabled:

Specified by:
some in interface QuasiBuilder

group

public AstroArg group(Object args)
Enabled:

Specified by:
group in interface QuasiBuilder
Parameters:
args - is a list of AstroArg.

dollarHole

public Astro dollarHole(Astro litInt)
Enabled:

Specified by:
dollarHole in interface QuasiBuilder

atHole

public Astro atHole(Astro litInt)
Enabled:

Specified by:
atHole in interface QuasiBuilder


comments?