
js_grammar.pl -- JavaScript grammar
This file provides a tokenizer for JavaScript (EcmaScript). This code
supports the quasi quotation syntax javascript
, defined in
library(http/js_write).
- See also
- - http://tomcopeland.blogs.com/EcmaScript.html is used for the
high-level syntax.
- - http://www.ecma-international.org/ecma-262/5.1/ is used for
implementing the tokenization code.
js_token(-TokenType)//- Matches and classifies the next JavaScript token.
- token(-Type) is semidet[private]
- Get the next token from the input. Fails when encountering the
end of the input.
- Errors
- -
syntax_error(Culprit)
comment// is semidet[private]
string_literal// is semidet[private]- Matches a string literal
numeric_literal//[private]- Matches JavaScript notion of a numeric constant
regex_literal// is semidet[private]- Matches regex expression /.../flags
q_codes//[private]- Shortest list of quoted characters.