This is the apg-exp
object constructor.
apg-exp
functions similarly to the built-in JavaScript RegExp
pattern matching engine.
However, patterns are described with an SABNF
syntax and matching is done with an
apg
parser.
See the user’s guide at ./dist/guide/index.html
for complete usage details.
module.exports = function apgExp(input, flags, nodeHits, treeDepth) {
'use strict;';
const apglib = require('../apg-lib/node-exports');
const execFuncs = require('./exec');
const replaceFuncs = require('./replace');
const resultFuncs = require('./result');
const splitFuncs = require('./split');
const setFlags = require('./flags');
const sabnfGenerator = require('./sabnf-generator');
const thisThis = this;
const thisFileName = 'apg-exp: ';
let errorName = thisFileName;
const readonly = {
writable: false,
enumerable: false,
configurable: true,
};
const priv = {
thisThis: this,
grammarObject: null,
ruleNames: [],
str: null,
chars: null,
parser: null,
result: null,
charsToString: null,
match(state) {
return state === apglib.ids.MATCH || state === apglib.ids.EMPTY;
},
};