Package kawa.lang
Class Quote
- java.lang.Object
-
- kawa.lang.Syntax
-
- kawa.lang.Quote
-
- All Implemented Interfaces:
gnu.kawa.format.Printable,Named
- Direct Known Subclasses:
syntax
public class Quote extends Syntax
The Syntax transformer that re-writes the "quote" "quasiquote" primitive. In both cases recursively resolves SyntaxForm wrappers and resolves namespaces of symbols. In the case of quasiquote also handles unquoting.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanisQuasiTrue for quasiquote; false for plain quote.static QuoteplainQuotestatic QuotequasiQuoteprotected static intQUOTE_DEPTHAn initial value for 'depth' for plain (non-quasi) quote.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Objectappend$V(Object[] args)Same as regular append, but handle SyntaxForm wrappers.protected ExpressioncoerceExpression(Object val, Translator tr)static ObjectconsX$V(Object[] args)A wrapper around LList.consX to make it a "variable-arg method".protected Objectexpand(Object template, int depth, Translator tr)protected booleanexpandColonForms()protected Expressionleaf(Object val, Translator tr)static SymbolmakeSymbol(Namespace ns, Object local)protected booleanmatchesQuasiQuote(Object form, SyntaxForm syntax, Translator tr)protected booleanmatchesUnquote(Pair pair, SyntaxForm syntax, Translator tr)protected booleanmatchesUnquoteSplicing(Pair pair, SyntaxForm syntax, Translator tr)static Objectquote(Object obj)Quote an object (without namespace-expansion).static Objectquote(Object obj, Translator tr)Quote an object (without namespace-expansion).Expressionrewrite(Object obj, Translator tr)Re-write an expression that is an "application" of this Syntax object.-
Methods inherited from class kawa.lang.Syntax
getName, getSymbol, print, rewriteForm, scanForDefinitions, scanForm, setName, setName
-
-
-
-
Field Detail
-
plainQuote
public static final Quote plainQuote
-
quasiQuote
public static final Quote quasiQuote
-
QUOTE_DEPTH
protected static final int QUOTE_DEPTH
An initial value for 'depth' for plain (non-quasi) quote.- See Also:
- Constant Field Values
-
isQuasi
protected boolean isQuasi
True for quasiquote; false for plain quote.
-
-
Constructor Detail
-
Quote
public Quote(String name, boolean isQuasi)
-
-
Method Detail
-
matchesUnquote
protected boolean matchesUnquote(Pair pair, SyntaxForm syntax, Translator tr)
-
matchesUnquoteSplicing
protected boolean matchesUnquoteSplicing(Pair pair, SyntaxForm syntax, Translator tr)
-
matchesQuasiQuote
protected boolean matchesQuasiQuote(Object form, SyntaxForm syntax, Translator tr)
-
expand
protected Object expand(Object template, int depth, Translator tr)
-
quote
public static Object quote(Object obj, Translator tr)
Quote an object (without namespace-expansion). Basically just recursively removes SyntaxForm wrappers.
-
quote
public static Object quote(Object obj)
Quote an object (without namespace-expansion). Basically just recursively removes SyntaxForm wrappers.
-
coerceExpression
protected Expression coerceExpression(Object val, Translator tr)
-
leaf
protected Expression leaf(Object val, Translator tr)
-
expandColonForms
protected boolean expandColonForms()
-
rewrite
public Expression rewrite(Object obj, Translator tr)
Description copied from class:SyntaxRe-write an expression that is an "application" of this Syntax object.
-
consX$V
public static Object consX$V(Object[] args)
A wrapper around LList.consX to make it a "variable-arg method".
-
-