Skip to content
Ioan CHIRIAC edited this page Aug 4, 2014 · 1 revision

Welcome to the jison-lex wiki!

List of lexer functions

  • setInput: resets the lexer, sets new input
  • input: consumes and returns one char from the input
  • unput: unshifts one char (or a string) into the input
  • more: When called from action, caches matched text and appends it on next action
  • reject: When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
  • less: retain first n characters of the match
  • pastInput: displays already matched input, i.e. for error messages
  • upcomingInput: displays upcoming input, i.e. for error messages
  • showPosition: displays the character position where the lexing error occurred, i.e. for error messages
  • test_match: test the lexed token: return FALSE when not a match, otherwise return token
  • next: return next match in input
  • lex: return next match that has a token
  • begin: activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
  • popState: pop the previously active lexer condition state off the condition stack
  • _currentRules: produce the lexer rule set which is active for the currently active lexer condition state
  • topState: return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
  • pushState: alias for begin(condition)
  • stateStackSize: return the number of states currently on the stack
Clone this wiki locally