buildOrRegexp

buildOrRegexp
Author: Alberto Rodriguez Fuentes Identification: alu0101017396 E-Mail: alu0101017396@ull.edu.es Date 17/04/2021 University of La Laguna Description: This program creates an lexic analyzer from an array with regular expressions
Parameters
regexps (any)

buildOrRegexp

Unites an array of regular expressions by ORs and add a sticky flag to it

buildOrRegexp
Parameters
regexps (array) array of pairs with the names and the regular expressions
Returns
object: regular expression with all the tokens united by ORs and with a sticky flag

buildLexer

This function creates an lexic analyzer from an array of pairs with regular expressions

buildLexer
Parameters
tokens (array) array of pairs with the names and the regular expressions
Returns
function: function that does a lexic analyze