This library provides an extensible hierarchy of structure types representing abstract JavaScript syntax. It can be required via:
struct
struct
name:Identifier?
struct
struct
struct
struct
struct
struct
value:string?
struct
patternglobal?case-insensitive?)pattern:string?global?:boolean?case-insensitive?:boolean?
struct
value:number?
struct
value:boolean?
struct
struct
struct
struct
struct
id:Identifier?
struct
container:Expression/X?key:Expression/X?
struct
container:Expression/X?id:Identifier?
struct
constructor:Expression/X?arguments:ExpressionList/X?
struct
expression:Expression/X?operator:PostfixOperator/c
struct
operator:PrefixOperator/cexpression:Expression/X?
struct
left:Expression/X?operator:InfixOperator/cright:Expression/X?
struct
testconsequentalternate)test:Expression/X?consequent:Expression/X?alternate:Expression/X?
struct
lhs:Expression/X?operator:AssignmentOperator/crhs:Expression/X?
struct
struct
body:Expression/X?
struct
method:Expression/X?args:ExpressionList/X?
struct
expression:Expression/X?
struct
expressions:ExpressionList/X?
struct
statements:SubStatementList/X?
struct
struct
expression:Expression/X?
struct
test:Expression/X?consequent:SubStatement/X?
struct
body:SubStatement/X?test:Expression/X?
struct
test:Expression/X?body:SubStatement/X?
struct
body:SubStatement/X?
struct
container:Expression/X?body:SubStatement/X?
struct
struct
struct
struct
body:SubStatement/X?
struct
context:Expression/X?body:SubStatement/X?
struct
expression:Expression/X?
struct
label:Identifier?statement:SubStatement/X?
struct
value:Expression/X?
struct
body:Statement/X?
struct
name:symbol?
struct
answer:SubStatementList/X?
struct
id:Identifier?body:Statement/X?
struct
id:Identifier?
struct
module:ModuleSpecifier?
struct
label:Identifier?
struct
struct
struct
module:ModuleSpecifier?exclusions:ExclusionList?
struct
procedure
( has-location? x)→boolean?
x:Term?
procedure
( ast-location x)→region?
procedure
( ast-source x)→any
procedure
( ast-start x)→position?
procedure
( ast-end x)→position?
procedure
( with-location locx)→Term?
x:Term?
procedure
( SubStatement? x)→boolean?
x:any
procedure
( SourceElement? x)→boolean?
x:any
procedure
( Identifier=? xy)→boolean?
value
value
value
value
procedure
procedure
x:any
procedure
( prefix-operator? x)→boolean?
x:any
procedure
( infix-operator? x)→boolean?
x:any
procedure
x:any
value
value
value
Some libraries in this package support extending the language. The notions of expression, statement, expression list, and statement list can be extended by adding custom predicates to the following parameters:
value
Expression-predicates :(parameter/c (listof (any -> boolean? )))
value
Statement-predicates :(parameter/c (listof (any -> boolean? )))
value
The following predicates represent extensible terms by checking an argument against the standard predicates followed by the corresponding custom predicates:
procedure
( Expression/X? x)→boolean?
x:anyprocedure
( Statement/X? x)→boolean?
x:anyprocedure
( SubStatement/X? x)→boolean?
x:anyprocedure
x:anyprocedure
( StatementList/X? x)→boolean?
x:anyprocedure
x:any