org.quasiliteral.term
Interface QuasiBuilder

All Superinterfaces:
AstroBuilder
All Known Implementing Classes:
QBuilder, QuasiBuilderAdaptor, QuasiMetaBuilder

public interface QuasiBuilder
extends AstroBuilder

Untamed:


Method Summary
 Astro atHole(Astro litInt)
          Enabled: Matches the specimen by placing it in 'bindings[litInt]'.
 AstroArg choice(AstroArg leftArg, AstroArg rightArg)
          Enabled: Matched anything matched by either leftArg or rightArg.
 boolean doesQuasis()
          Enabled: A kludge because of the current (pre-Antlr) lack of grammar inheritance.
 Astro dollarHole(Astro litInt)
          Enabled: On substitution, "evaluates" to 'args[litInt]'.
 AstroArg group(Object args)
          Enabled: Treat the 'args' list as a repeating sequence.
 AstroArg interleave(AstroArg leftArg, AstroArg rightArg)
          Enabled: Matched any sequence in which both leftArg and rightArg are matched exactly once.
 AstroArg some(AstroArg optSub, String quant)
          Enabled: Matches a consecutive sequence of Terms matched by optTerm, where the number matched is constrained by quant.
 Astro taggedHole(Astro ident, Astro functorHole)
          Enabled:
 
Methods inherited from interface org.quasiliteral.astro.AstroBuilder
bag, composite, getSchema, leafChar, leafData, leafFloat64, leafInteger, leafLong, leafString, leafTag, leafTwine, list, list, list, list, list, start, term, term, tuple, unpack, with
 

Method Detail

doesQuasis

public boolean doesQuasis()
Enabled: A kludge because of the current (pre-Antlr) lack of grammar inheritance.

If this is false, then the only production which work are the ones inherited from AstroBuilder, and this is really an AstroBuilder in QuasiBuilder clothing. This flag is also, by default, used to tell the lexer whether to collapse double quasi characters -- '@', '$', and '`'.


taggedHole

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


choice

public AstroArg choice(AstroArg leftArg,
                       AstroArg rightArg)
Enabled: Matched anything matched by either leftArg or rightArg.

Adds a "?" to the rank of both arguments.


interleave

public AstroArg interleave(AstroArg leftArg,
                           AstroArg rightArg)
Enabled: Matched any sequence in which both leftArg and rightArg are matched exactly once.

Does not affect the rank of the arguments, since they are still exactly-once.

XXX rewrite para: If 'leftArg' is itself a bag (the result of a call to interleave), then the new effective bag is rightArg + the members of leftArg. This matches any sequence in which each member of the sequence matches a unique member of the bag, and all the members of the bag are matched.

This is inspired by the '&' of RELAX-NG's Non-XML Syntax, which expands to RELAX-NG's "interleave" tag, though we don't yet know how closely the semantics of the two can correspond. (If 'interleave' can correspond perfectly to RELAX-NG's interleave tag, then we will so specify.)


some

public AstroArg some(AstroArg optSub,
                     String quant)
Enabled: Matches a consecutive sequence of Terms matched by optTerm, where the number matched is constrained by quant.

Adds quant to the rank of optTerm.


group

public AstroArg group(Object args)
Enabled: Treat the 'args' list as a repeating sequence.

Matches a consecutive sequence of subsequences matched by 'args'. Doesn't affect rank since each arg is exactly once.

Parameters:
args - is a list of AstroArg.

dollarHole

public Astro dollarHole(Astro litInt)
Enabled: On substitution, "evaluates" to 'args[litInt]'.

On matching, matches if 'args[litInt] <=> specimen'


atHole

public Astro atHole(Astro litInt)
Enabled: Matches the specimen by placing it in 'bindings[litInt]'.



comments?