Rena.action

method

Parameters
NameTypeDescription
actionObjectaction an action
Return
TypeDescription
Renathis instance

execute the given action and sets the return value as the attribute.

Rena.action

static method

Parameters
NameTypeDescription
actionObjectaction an action
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().action()'.

Rena.atLeast

method

Parameters
NameTypeDescription
countNumbercount minimum of repetation
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis instance

repeats the given patterns at least the given count.
This instance cannot chain matching after this call except br() and isEnd().

Rena.atLeast

static method

Parameters
NameTypeDescription
countNumbercount minimum of repetation
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().thenAtLeast()'.

Rena.atLeastArray

method

Parameters
NameTypeDescription
countNumbercount minimum of repetation
patternObjectpattern a pattern to match
Return
TypeDescription
Renathis 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().

Rena.atLeastArray

static method

Parameters
NameTypeDescription
countNumbercount minimum of repetation
patternObjectpattern a pattern to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().atLeastArray()'.

Rena.atMost

method

Parameters
NameTypeDescription
countNumbercount maximum of repetation
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis instance

repeats the given patterns at most the given count.
This instance cannot chain matching after this call except br() and isEnd().

Rena.atMost

static method

Parameters
NameTypeDescription
countNumbercount maximum of repetation
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().thenAtMost()'.

Rena.atMostArray

method

Parameters
NameTypeDescription
countNumbercount maximum of repetation
patternObjectpattern a pattern to match
Return
TypeDescription
Renathis 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().

Rena.atMostArray

static method

a shortcut for 'Rena().atMostArray()'.

Rena.attr

method

Parameters
NameTypeDescription
attrObjectattr an attribute
Return
TypeDescription
Renathis instance

sets the given value as the attribute.

Rena.attr

static method

Parameters
NameTypeDescription
attrObjectattr an attribute
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().attr()'.

Rena.br

method

Return
TypeDescription
Renathis instance

matches a newline.

Rena.br

static method

Return
TypeDescription
Renanew instance

a shortcut for 'Rena().br()'.

Rena.cond

method

Parameters
NameTypeDescription
condFunctioncond the condition
Return
TypeDescription
Renathis instance

matches the pattern if the given condition is truthy.

Rena.cond

static method

Parameters
NameTypeDescription
patternFunctioncond the condition
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().cond()'.

Rena.createKey

static method

Return
TypeDescription
Triea trie tree of keywords

creates the keywords.

Rena.delimit

method

Parameters
NameTypeDescription
delimiterObjectdelimiter a pattern of delimiter
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis instance

matches a string which is delimited by the given string.
This instance cannot chain matching after this call except br() and isEnd().

Rena.delimit

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
delimiterObjectdelimiter a pattern of delimiter
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().thenDelimit()'.

Rena.delimitArray

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
delimiterObjectdelimiter a pattern of delimiter
Return
TypeDescription
Renathis 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().

Rena.delimitArray

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
delimiterObjectdelimiter a pattern of delimiter
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().delimitArray()'.

Rena.equalsId

method

Parameters
NameTypeDescription
idStringid identifier to match
Return
TypeDescription
Renathis instance

matches the identifier.

Rena.equalsId

static method

Parameters
NameTypeDescription
idStringid identifier to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().equalsId()'.

Rena.F

static method

a function which returns second argument.

Rena.first

static method

a function which returns first argument.

Rena.I

static method

a function which returns first argument.

Rena.ignore

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to be ignored

sets the pattern to be ignored locally.

Rena.ignoreDefault

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to be ignored
RenaModulethis Rena module

sets the pattern to be ignored.

Rena.isEnd

method

Return
TypeDescription
Renathis instance

matches end of string

Rena.isEnd

static method

Return
TypeDescription
Renanew instance

a shortcut for 'Rena().isEnd()'.

Rena.key

method

Parameters
NameTypeDescription
wordStringword a keyword to be matched
trieTrietrie a trie tree to match
Return
TypeDescription
Renathis instance

matches a keyword.

Rena.key

static method

Parameters
NameTypeDescription
wordStringword a keyword to be matched
trieTrietrie a trie tree to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().key()'.

Rena.letrec

static method

An alias of Rena.Yn().

Rena.lookahead

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
positiveBooleanpositive succeed when the pattern does not match if this value is falsy
Return
TypeDescription
Renathis instance

matches the pattern not consuming the string to be matched.

Rena.lookahead

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
positiveBooleanpositive succeed when the pattern does not match if this value is falsy
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().lookahead()'.

Rena.lookaheadNot

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renathis instance

a shortcut of 'lookahead(pattern, false)'.

Rena.lookaheadNot

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().lookaheadNot()'.

Rena.maybe

method

Parameters
NameTypeDescription
actionFunctionaction an action to be invoked
Return
TypeDescription
Renathis instance

matches zero or one of the given patterns.
This instance cannot chain matching after this call except br() and isEnd().

Rena.maybe

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().thenMaybe()'.

Rena.notKey

method

Parameters
NameTypeDescription
trieTrietrie a trie tree to match
Return
TypeDescription
Renathis instance

checks whether any keywords are not matched.

Rena.notKey

static method

Parameters
NameTypeDescription
trieTrietrie a trie tree to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().notKey()'.

Rena.oneOrMore

method

Parameters
NameTypeDescription
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis instance

a shortcut of 'atLeast(1, pattern, action, init)'.
This instance cannot chain matching after this call except br() and isEnd().

Rena.oneOrMore

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().thenOneOrMore()'.

Rena.oneOrMoreArray

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renathis instance

a shortcut of 'atLeastArray(1, pattern)'.
This instance cannot chain matching after this call except br() and isEnd().

Rena.oneOrMoreArray

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().oneOrMoreArray()'.

Rena.or

method

Return
TypeDescription
Renathis instance

matches one of the given patterns.

Rena.or

static method

Return
TypeDescription
Renanew instance

a shortcut for 'Rena().or()'.

Rena.parse

method

Parameters
NameTypeDescription
strStringstr a string to be parsed
attributeObjectattribute an initial attribute

parses the given string entirely.

Rena.parsePart

method

Parameters
NameTypeDescription
strStringstr a string to be parsed
attributeObjectattribute an initial attribute

parses the given string partially.

Rena.parsePartGlobal

method

Parameters
NameTypeDescription
strStringstr a string to be parsed
initObjectinit an initial attribute
actionFunctionaction a function to accumlate attributes
Return
TypeDescription
Objectaccumlated attribute

parses the given string continuously.

Rena.parsePartGlobalArray

method

Parameters
NameTypeDescription
strStringstr a string to be parsed
Return
TypeDescription
Objectarray of accumlated attribute

parses the given string continuously and accumlate to an array.

Rena.parseStart

method

Parameters
NameTypeDescription
strStringstr a string to be parsed
indexNumberindex an index to start
attributeObjectattribute an initial attribute

parses the given string from the given index.

Rena.passAll

method

Return
TypeDescription
Renathis instance

ignores all action after this.

Rena.passAll

static method

Return
TypeDescription
Renanew instance

a shortcut for 'Rena().passAll()'.

Rena.real

method

Parameters
NameTypeDescription
signumBooleansignum matches sign if signum is true
Return
TypeDescription
Reanthis instance

matches a float number and sets the number as an attribute.

Rena.real

static method

Parameters
NameTypeDescription
signumBooleansignum matches sign if signum is true
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().real()'.

Rena.second

static method

a function which returns second argument.

Rena.setKey

static method

sets the keywords.

Rena.SK

static method

a function which returns second argument.

Rena.t

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
Return
TypeDescription
Renathis instance

a shortcut of 'then'.

Rena.t

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().t()'.

Rena.then

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
Return
TypeDescription
Renathis 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.

Rena.then

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().then()'.

Rena.thenAtLeast

method

Parameters
NameTypeDescription
countNumbercount minimum of repetation
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis instance

repeats the given patterns at least the given count.
This instance cannot chain matching after this call except br() and isEnd().

Rena.thenAtMost

method

Parameters
NameTypeDescription
countNumbercount maximum of repetation
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis instance

repeats the given patterns at most the given count.
This instance cannot chain matching after this call except br() and isEnd().

Rena.thenDelimit

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
delimiterObjectdelimiter a pattern of delimiter
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis instance

matches a string which is delimited by the given string.
This instance cannot chain matching after this call except br() and isEnd().

Rena.thenFloat

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renathis instance

a shortcut of 'then(pattern, function(x) { return parseFloat(x); })'.

Rena.thenFloat

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().thenFloat()'.

Rena.thenInt

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renathis instance

a shortcut of 'then(pattern, function(x) { return parseInt(x); })'.

Rena.thenInt

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().thenInt()'.

Rena.thenMaybe

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
Return
TypeDescription
Renathis instance

matches zero or one of the given patterns.
This instance cannot chain matching after this call except br() and isEnd().

Rena.thenOneOrMore

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis instance

a shortcut of 'atLeast(1, pattern, action, init)'.
This instance cannot chain matching after this call except br() and isEnd().

Rena.thenPass

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renathis instance

a shortcut of 'then(pattern, Rena.pass)'.

Rena.thenPass

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().thenPass()'.

Rena.thenTimes

method

Parameters
NameTypeDescription
countminNumbercountmin minimum of repetation
countmaxNumbercountmax maximum of repetation
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis 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.

Rena.thenZeroOrMore

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis instance

a shortcut of 'atLeast(0, pattern, action, init)'.
This instance cannot chain matching after this call except br() and isEnd().

Rena.times

method

Parameters
NameTypeDescription
countminNumbercountmin minimum of repetation
countmaxNumbercountmax maximum of repetation
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis 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.

Rena.times

static method

Parameters
NameTypeDescription
countminNumbercountmin minimum of repetation
countmaxNumbercountmax maximum of repetation
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().thenTimes()'.

Rena.timesArray

method

Parameters
NameTypeDescription
countminNumbercountmin minimum of repetation
countmaxNumbercountmax maximum of repetation
patternObjectpattern a pattern to match
Return
TypeDescription
Renathis 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().

Rena.timesArray

static method

Parameters
NameTypeDescription
countminNumbercountmin minimum of repetation
countmaxNumbercountmax maximum of repetation
patternObjectpattern a pattern to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().timesArray()'.

Rena.Y

static method

a fixed point combinator.

Rena.Yn

static method

a multiple fixed point combinator.
http://okmij.org/ftp/Computation/fixed-point-combinators.html

Rena.zeroOrMore

method

Parameters
NameTypeDescription
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renathis instance

a shortcut of 'atLeast(0, pattern, action, init)'.
This instance cannot chain matching after this call except br() and isEnd().

Rena.zeroOrMore

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
actionFunctionaction an action to be invoked
initObjectinit an initial attribute
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().thenZeroOrMore()'.

Rena.zeroOrMoreArray

method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renathis instance

a shortcut of 'atLeastArray(0, pattern)'.
This instance cannot chain matching after this call except br() and isEnd().

Rena.zeroOrMoreArray

static method

Parameters
NameTypeDescription
patternObjectpattern a pattern to match
Return
TypeDescription
Renanew instance

a shortcut for 'Rena().zeroOrMoreArray()'.