The below code snippet can be found on: http://zaach.github.io/jison/demos/calc/, and also the jison documentation page. After reading the jison, lex, and flex documentation - I still don't fully understand the %lex and /lex syntax. Is it specific to the jison scanner generator? Meaning is its only function to provide the json output later shown in the documentation? I only ask because the jison documentation doesn't explicitly explain its purpose, and the flex/lex rules don't seem to allow for such syntax.
/* description: Parses end executes mathematical expressions. */
/* lexical grammar */
%lex
%%
\s+ /* skip whitespace */
[0-9]+("."[0-9]+)?\b return 'NUMBER';
"*" return '*';
"/" return '/';
"-" return '-';
"+" return '+';
"^" return '^';
"(" return '(';
")" return ')';
"PI" return 'PI';
"E" return 'E';
<<EOF>> return 'EOF';
/lex