method
ParametersName | Type | Description |
---|---|---|
action | Object | action an action |
Type | Description |
---|---|
Rena | this instance |
execute the given action and sets the return value as the attribute.
static method
ParametersName | Type | Description |
---|---|---|
action | Object | action an action |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().action()'.
method
ParametersName | Type | Description |
---|---|---|
count | Number | count minimum of repetation |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
repeats the given patterns at least the given count.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
count | Number | count minimum of repetation |
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().thenAtLeast()'.
method
ParametersName | Type | Description |
---|---|---|
count | Number | count minimum of repetation |
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | this instance |
repeats the given patterns at least the given count with accumlating an attribute into array.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
count | Number | count minimum of repetation |
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().atLeastArray()'.
method
ParametersName | Type | Description |
---|---|---|
count | Number | count maximum of repetation |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
repeats the given patterns at most the given count.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
count | Number | count maximum of repetation |
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().thenAtMost()'.
method
ParametersName | Type | Description |
---|---|---|
count | Number | count maximum of repetation |
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | this instance |
repeats the given patterns at most the given count with accumlating an attribute into array.
This instance cannot chain matching after this call except br() and isEnd().
static method
a shortcut for 'Rena().atMostArray()'.
method
ParametersName | Type | Description |
---|---|---|
attr | Object | attr an attribute |
Type | Description |
---|---|
Rena | this instance |
sets the given value as the attribute.
static method
ParametersName | Type | Description |
---|---|---|
attr | Object | attr an attribute |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().attr()'.
method
ReturnType | Description |
---|---|
Rena | this instance |
matches a newline.
static method
ReturnType | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().br()'.
method
ParametersName | Type | Description |
---|---|---|
cond | Function | cond the condition |
Type | Description |
---|---|
Rena | this instance |
matches the pattern if the given condition is truthy.
static method
ParametersName | Type | Description |
---|---|---|
pattern | Function | cond the condition |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().cond()'.
static method
ReturnType | Description |
---|---|
Trie | a trie tree of keywords |
creates the keywords.
method
ParametersName | Type | Description |
---|---|---|
delimiter | Object | delimiter a pattern of delimiter |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
matches a string which is delimited by the given string.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
delimiter | Object | delimiter a pattern of delimiter |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().thenDelimit()'.
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
delimiter | Object | delimiter a pattern of delimiter |
Type | Description |
---|---|
Rena | this instance |
matches a string which is delimited by the given string with accumlating an attribute into array.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
delimiter | Object | delimiter a pattern of delimiter |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().delimitArray()'.
method
ParametersName | Type | Description |
---|---|---|
id | String | id identifier to match |
Type | Description |
---|---|
Rena | this instance |
matches the identifier.
static method
ParametersName | Type | Description |
---|---|---|
id | String | id identifier to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().equalsId()'.
static method
a function which returns second argument.
static method
a function which returns first argument.
static method
a function which returns first argument.
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to be ignored |
sets the pattern to be ignored locally.
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to be ignored |
RenaModule | this Rena module |
sets the pattern to be ignored.
method
ReturnType | Description |
---|---|
Rena | this instance |
matches end of string
static method
ReturnType | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().isEnd()'.
method
ParametersName | Type | Description |
---|---|---|
word | String | word a keyword to be matched |
trie | Trie | trie a trie tree to match |
Type | Description |
---|---|
Rena | this instance |
matches a keyword.
static method
ParametersName | Type | Description |
---|---|---|
word | String | word a keyword to be matched |
trie | Trie | trie a trie tree to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().key()'.
static method
An alias of Rena.Yn().
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
positive | Boolean | positive succeed when the pattern does not match if this value is falsy |
Type | Description |
---|---|
Rena | this instance |
matches the pattern not consuming the string to be matched.
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
positive | Boolean | positive succeed when the pattern does not match if this value is falsy |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().lookahead()'.
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'lookahead(pattern, false)'.
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().lookaheadNot()'.
method
ParametersName | Type | Description |
---|---|---|
action | Function | action an action to be invoked |
Type | Description |
---|---|
Rena | this instance |
matches zero or one of the given patterns.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().thenMaybe()'.
method
ParametersName | Type | Description |
---|---|---|
trie | Trie | trie a trie tree to match |
Type | Description |
---|---|
Rena | this instance |
checks whether any keywords are not matched.
static method
ParametersName | Type | Description |
---|---|---|
trie | Trie | trie a trie tree to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().notKey()'.
method
ParametersName | Type | Description |
---|---|---|
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'atLeast(1, pattern, action, init)'.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().thenOneOrMore()'.
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'atLeastArray(1, pattern)'.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().oneOrMoreArray()'.
method
ReturnType | Description |
---|---|
Rena | this instance |
matches one of the given patterns.
static method
ReturnType | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().or()'.
method
ParametersName | Type | Description |
---|---|---|
str | String | str a string to be parsed |
attribute | Object | attribute an initial attribute |
parses the given string entirely.
method
ParametersName | Type | Description |
---|---|---|
str | String | str a string to be parsed |
attribute | Object | attribute an initial attribute |
parses the given string partially.
method
ParametersName | Type | Description |
---|---|---|
str | String | str a string to be parsed |
init | Object | init an initial attribute |
action | Function | action a function to accumlate attributes |
Type | Description |
---|---|
Object | accumlated attribute |
parses the given string continuously.
method
ParametersName | Type | Description |
---|---|---|
str | String | str a string to be parsed |
Type | Description |
---|---|
Object | array of accumlated attribute |
parses the given string continuously and accumlate to an array.
method
ParametersName | Type | Description |
---|---|---|
str | String | str a string to be parsed |
index | Number | index an index to start |
attribute | Object | attribute an initial attribute |
parses the given string from the given index.
method
ReturnType | Description |
---|---|
Rena | this instance |
ignores all action after this.
static method
ReturnType | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().passAll()'.
method
ParametersName | Type | Description |
---|---|---|
signum | Boolean | signum matches sign if signum is true |
Type | Description |
---|---|
Rean | this instance |
matches a float number and sets the number as an attribute.
static method
ParametersName | Type | Description |
---|---|---|
signum | Boolean | signum matches sign if signum is true |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().real()'.
static method
a function which returns second argument.
static method
sets the keywords.
static method
a function which returns second argument.
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'then'.
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().t()'.
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
Type | Description |
---|---|
Rena | this instance |
matches to the pattern simply.
A simple string, a regular expression, a function or a Rena object can be specified as a pattern.
The matching function must have two arguments,
first argument is the string to match and second argument is the position to match,
and return an object if it matches or null if it does not match.
The object to be returned has two properties,
one of this is the matched string which named "match",
another is the matched last position which named "lastMatch".
The given action will be called back with two or three arguments,
first argument is the matched string,
second argument is the inherited attribute,
third argument is the synthesized attribute.
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().then()'.
method
ParametersName | Type | Description |
---|---|---|
count | Number | count minimum of repetation |
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
repeats the given patterns at least the given count.
This instance cannot chain matching after this call except br() and isEnd().
method
ParametersName | Type | Description |
---|---|---|
count | Number | count maximum of repetation |
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
repeats the given patterns at most the given count.
This instance cannot chain matching after this call except br() and isEnd().
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
delimiter | Object | delimiter a pattern of delimiter |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
matches a string which is delimited by the given string.
This instance cannot chain matching after this call except br() and isEnd().
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'then(pattern, function(x) { return parseFloat(x); })'.
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().thenFloat()'.
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'then(pattern, function(x) { return parseInt(x); })'.
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().thenInt()'.
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
Type | Description |
---|---|
Rena | this instance |
matches zero or one of the given patterns.
This instance cannot chain matching after this call except br() and isEnd().
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'atLeast(1, pattern, action, init)'.
This instance cannot chain matching after this call except br() and isEnd().
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'then(pattern, Rena.pass)'.
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().thenPass()'.
method
ParametersName | Type | Description |
---|---|---|
countmin | Number | countmin minimum of repetation |
countmax | Number | countmax maximum of repetation |
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
repeats the given patterns to the given count.
This instance cannot chain matching after this call except br() and isEnd().
The given action will be called back with three arguments,
first argument is the matched string,
second argument is the attribute of repeating pattern,
third argument is the inherited attribute.
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'atLeast(0, pattern, action, init)'.
This instance cannot chain matching after this call except br() and isEnd().
method
ParametersName | Type | Description |
---|---|---|
countmin | Number | countmin minimum of repetation |
countmax | Number | countmax maximum of repetation |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
repeats the given patterns to the given count.
This instance cannot chain matching after this call except br() and isEnd().
The given action will be called back with three arguments,
first argument is the matched string,
second argument is the attribute of repeating pattern,
third argument is the inherited attribute.
static method
ParametersName | Type | Description |
---|---|---|
countmin | Number | countmin minimum of repetation |
countmax | Number | countmax maximum of repetation |
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().thenTimes()'.
method
ParametersName | Type | Description |
---|---|---|
countmin | Number | countmin minimum of repetation |
countmax | Number | countmax maximum of repetation |
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | this instance |
repeats the given patterns to the given count with accumlating an attribute into array.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
countmin | Number | countmin minimum of repetation |
countmax | Number | countmax maximum of repetation |
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().timesArray()'.
static method
a fixed point combinator.
static method
a multiple fixed point combinator.
http://okmij.org/ftp/Computation/fixed-point-combinators.html
method
ParametersName | Type | Description |
---|---|---|
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'atLeast(0, pattern, action, init)'.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
action | Function | action an action to be invoked |
init | Object | init an initial attribute |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().thenZeroOrMore()'.
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | this instance |
a shortcut of 'atLeastArray(0, pattern)'.
This instance cannot chain matching after this call except br() and isEnd().
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern a pattern to match |
Type | Description |
---|---|
Rena | new instance |
a shortcut for 'Rena().zeroOrMoreArray()'.