webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Public Member Functions | |
__construct ($start, $end=null) | |
start () | |
end () | |
Public Attributes | |
const | ALL_WHITESPACE = '/(\s|\r|\n)+/' |
const | C_IDENTIFIER = '/[a-z_][a-z0-9_]*/i' |
const | C_COMMENT = '#//.*?\n|/\*.*?\*/#s' |
const | C_MULTILINECOMMENT = '#/\*.*?\*/#s' |
const | DOUBLEQUOTESTRING = '/"(?:\\\\"|.)*?"/s' |
const | SINGLEQUOTESTRING = "/'(?:\\\\'|.)*?'/s" |
const | C_DOUBLEQUOTESTRING = '/L?"(?:\\\\"|.)*?"/s' |
const | C_SINGLEQUOTESTRING = "/L?'(?:\\\\'|.)*?'/s" |
const | STRING = '/"(?:\\\\"|.)*?"|\'(?:\\\\\'|.)*?\'/s' |
const | C_NUMBER |
Represents a nesting rule in the grammar of a language definition.
Individual rules can either be represented by raw strings ("simple" rules) or by a nesting rule. Nesting rules specify where they can start and end. Inside a nesting rule, other rules may be applied (both simple and nesting). For example, a nesting rule may define a string literal. Inside that string, other rules may be applied that recognize escape sequences.
To use a nesting rule, supply how it may start and end, e.g.: $string_rule = array('string' => new Rule('/"/', '/"/'));
You also need to specify nested states: $string_states = array('string' => 'escaped');
Now you can add another rule for escaped:
$escaped_rule = array('escaped' => '/\(x{1,4}|.)/');
Rule::__construct | ( | $start, | |
$end = null |
|||
) |
Rule::end | ( | ) |
Returns the pattern with which this rule may end.
Rule::start | ( | ) |
Returns the pattern with which this rule starts.
const Rule::C_DOUBLEQUOTESTRING = '/L?"(?:\\\\"|.)*?"/s' |
const Rule::C_MULTILINECOMMENT = '#/\*.*?\*/#s' |
const Rule::C_NUMBER |
const Rule::C_SINGLEQUOTESTRING = "/L?'(?:\\\\'|.)*?'/s" |
const Rule::DOUBLEQUOTESTRING = '/"(?:\\\\"|.)*?"/s' |
const Rule::SINGLEQUOTESTRING = "/'(?:\\\\'|.)*?'/s" |
const Rule::STRING = '/"(?:\\\\"|.)*?"|\'(?:\\\\\'|.)*?\'/s' |