branch: externals/parser-generator commit f5a5801dd08edf8b5f4e536531af0db0586d75ba Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Clarified lex-analyzer exporting necessities --- docs/Lexical-Analysis.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/Lexical-Analysis.md b/docs/Lexical-Analysis.md index 27d0722..00b617c 100644 --- a/docs/Lexical-Analysis.md +++ b/docs/Lexical-Analysis.md @@ -2,6 +2,10 @@ Set lexical analysis function by setting variable `parser-generator-lex-analyzer--function`. Optionally set reset function by setting variable `parser-generator-lex-analyzer--reset-function`. The lexical analysis is indexed on variable `parser-generator-lex-analyzer--index`. All parsers expect a list of tokens as response from lexical-analysis. +If you detect that the pointer needs to move, set flag `parser-generator-lex-analyzer--move-to-index-flag` to non-nil to move lex-analyzer position. + +To enable exporting the functions need to be specified in a way that the entire body is within the same block, do that using `(let)` or `(progn)` for example. + ## Token A token is defined as a list with 3 elements, first is a string or symbol, second is the start index of token in stream and third is the end index of token in stream, second and third element have a dot between them, this structure is to be compatible with Emacs Semantic system. Example token: @@ -54,7 +58,7 @@ Returns the look-ahead number of next terminals in stream, if end of stream is r ## Pop token -Returns the next token in stream and moves the lexical analyzer index one point forward. If end of stream is reached return nil. The result is expected to be a list containing each token popped. +Returns the next token in stream and moves the lexical analyzer index one point forwa<rd. If end of stream is reached return nil. The result is expected to be a list containing each token popped. ``` emacs-lisp (require 'ert)