method
ParametersName | Type | Description |
---|---|---|
action | Object | action 実行するアクション |
Type | Description |
---|---|
Rena | このインスタンス |
与えられたアクションを実行し、戻り値を属性としてセットします。
static method
ParametersName | Type | Description |
---|---|---|
action | Object | action 実行するアクション |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().action()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
count | Number | count 繰り返しの最小数 |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
与えられた回数以上パターンをマッチします。
このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
count | Number | count 繰り返しの最小数 |
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().thenAtLeast()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
count | Number | count 繰り返しの最小数 |
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | このインスタンス |
与えられた回数以上パターンをマッチして属性を配列に格納します。
このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
count | Number | count 繰り返しの最小数 |
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().atLeastArray()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
count | Number | count 繰り返しの最大数 |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
最大与えられた回数までパターンをマッチします。
このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
count | Number | count 繰り返しの最大数 |
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().thenAtMost()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
count | Number | count 繰り返しの最大数 |
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | このインスタンス |
最大与えられた回数までパターンをマッチして属性を配列に格納します。
このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
count | Number | count 繰り返しの最大数 |
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().atMostArray()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
attr | Object | attr セットする属性 |
Type | Description |
---|---|
Rena | このインスタンス |
属性を与えられた値にセットします。
static method
ParametersName | Type | Description |
---|---|---|
attr | Object | attr セットする属性 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().attr()'のショートカットです。
method
ReturnType | Description |
---|---|
Rena | このインスタンス |
改行文字にマッチします。
static method
ReturnType | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().br()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
cond | Function | cond 条件 |
Type | Description |
---|---|
Rena | このインスタンス |
属性が与えられた条件を満たすときにパターンにマッチします。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Function | cond 条件 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().cond()'のショートカットです。
static method
ReturnType | Description |
---|---|
Trie | キーワードの集合 |
キーワードの集合を生成します。
method
ParametersName | Type | Description |
---|---|---|
delimiter | Object | delimiter デリミタのパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
与えれれたデリミタで区切られたパターンにマッチします。 このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
delimiter | Object | delimiter デリミタのパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().thenDelimit()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
delimiter | Object | delimiter デリミタのパターン |
Type | Description |
---|---|
Rena | このインスタンス |
与えれれたデリミタで区切られたパターンにマッチします。 このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
delimiter | Object | delimiter デリミタのパターン |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().delimitArray()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
id | String | id マッチする識別子 |
Type | Description |
---|---|
Rena | このインスタンス |
識別子にマッチします。
文字列の後に空白またはトークンが続くときにマッチします。
static method
ParametersName | Type | Description |
---|---|---|
id | String | id マッチする識別子 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().equalsId()'のショートカットです。
static method
2番目の引数を返す関数です。
static method
最初の引数を返す関数です。
static method
最初の引数を返す関数です。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern 無視されるパターン |
局所的に無視されるパターンをセットします。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern 無視されるパターン |
RenaModule | this このモジュール |
無視されるパターンをセットします。
method
ReturnType | Description |
---|---|
Rena | このインスタンス |
文字列の終わりにマッチします。
static method
ReturnType | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().isEnd()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
word | String | word マッチさせるキーワード |
trie | Trie | trie キーワードの集合 |
Type | Description |
---|---|
Rena | このインスタンス |
キーワードにマッチします。
static method
ParametersName | Type | Description |
---|---|---|
word | String | word マッチさせるキーワード |
trie | Trie | trie キーワードの集合 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().key()'のショートカットです。
static method
Rena.Yn()のエイリアスです。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
positive | Boolean | positive trueのとき先読みが一致したときマッチ、falsenのとき先読みが一致しないときマッチ |
Type | Description |
---|---|
Rena | このインスタンス |
パターンを文字列を消費せずに先読みします。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
positive | Boolean | positive trueのとき先読みが一致したときマッチ、falsenのとき先読みが一致しないときマッチ |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().lookahead()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | このインスタンス |
パターンを文字列を消費せずに否定先読みします。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().lookaheadNot()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
action | Function | action 呼び出されるアクション |
Type | Description |
---|---|
Rena | このインスタンス |
0回または1回パターンをマッチします。
このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().thenMaybe()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
trie | Trie | trie キーワードの集合 |
Type | Description |
---|---|
Rena | このインスタンス |
いかなるキーワードにもマッチしないときにマッチします。
static method
ParametersName | Type | Description |
---|---|---|
trie | Trie | trie キーワードの集合 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().notKey()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
'atLeast(1, pattern, action, init)'のショートカットです。
このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().thenOneOrMore()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | このインスタンス |
'atLeastArray(1, pattern, action, init)'のショートカットです。
このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().oneOrMoreArray()'のショートカットです。
method
ReturnType | Description |
---|---|
Rena | このインスタンス |
引数のパターンのいずれかにマッチするときマッチします。
バックトラックができます。
static method
ReturnType | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().or()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
str | String | str パースする文字列 |
attribute | Object | attribute 初期の属性 |
文字列全体をパースします。
method
ParametersName | Type | Description |
---|---|---|
str | String | str パースする文字列 |
attribute | Object | attribute 初期の属性 |
部分的にパースします。
method
ParametersName | Type | Description |
---|---|---|
str | String | str パースする文字列 |
init | Object | init 初期の属性 |
action | Function | action 属性を累積する関数 |
Type | Description |
---|---|
Object | 累積された値 |
部分的に繰り返してパースします。
method
ParametersName | Type | Description |
---|---|---|
str | String | str パースする文字列 |
Type | Description |
---|---|
Object | 累積された値 |
部分的に繰り返してパースして配列に格納します。
method
ParametersName | Type | Description |
---|---|---|
str | String | str パースする文字列 |
index | Number | index マッチを開始する位置 |
attribute | Object | attribute 初期の属性 |
与えられた位置からパースを開始します。
method
ReturnType | Description |
---|---|
Rena | このインスタンス |
このメソッドの後のアクションを無視します。
static method
ReturnType | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().passAll()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
signum | Boolean | signum trueのとき符号にもマッチさせる |
Type | Description |
---|---|
Rean | このインスタンス |
浮動小数点数にマッチし、その値を属性として返します。
static method
ParametersName | Type | Description |
---|---|---|
signum | Boolean | signum trueのとき符号にもマッチさせる |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().real()'のショートカットです。
static method
2番目の引数を返す関数です。
static method
キーワードをセットします。
static method
2番目の引数を返す関数です。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
Type | Description |
---|---|
Rena | このインスタンス |
'then'のショートカットです。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().t()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
Type | Description |
---|---|
Rena | このインスタンス |
単純にパターンとマッチします。
パターンには単純な文字列、正規表現、関数、Renaオブジェクトが指定できます。
マッチする関数は2つの引数を持ちます。
最初の引数はマッチさせる文字列、2番目の引数はマッチさせたい文字列の位置が指定されます。
関数はオブジェクト(マッチしたとき)、またはnull(マッチしなかったとき)を返します。
オブジェクトは2つのプロパティを持つ必要があります。
マッチしたオブジェクトを格納する"match"と、マッチした最後の位置を表す"lastMatch"です。
アクションは2つか3つの引数とともにコールバックされます。
最初の引数はマッチした文字列、2番目の引数は継承された属性、3番目はマッチしたパターンが返した属性です。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().then()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
count | Number | count 繰り返しの最小数 |
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
与えられた回数以上パターンをマッチします。
このメソッドの後にパターンをマッチすることはできません。
method
ParametersName | Type | Description |
---|---|---|
count | Number | count 繰り返しの最大数 |
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
最大与えられた回数までパターンをマッチします。
このメソッドの後にパターンをマッチすることはできません。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
delimiter | Object | delimiter デリミタのパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
与えれれたデリミタで区切られたパターンにマッチします。 このメソッドの後にパターンをマッチすることはできません。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | このインスタンス |
'then(pattern, function(x) { return parseFloat(x); })'のショートカットです。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().thenFloat()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | このインスタンス |
'then(pattern, function(x) { return parseInt(x); })'のショートカットです。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().thenInt()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
Type | Description |
---|---|
Rena | このインスタンス |
0回または1回パターンをマッチします。
このメソッドの後にパターンをマッチすることはできません。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
'atLeast(1, pattern, action, init)'のショートカットです。
このメソッドの後にパターンをマッチすることはできません。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | このインスタンス |
'then(pattern, Rena.pass)'のショートカットです。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().thenPass()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
countmin | Number | countmin 繰り返しの最小数 |
countmax | Number | countmax 繰り返しの最大数 |
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
与えられたバターンを与えられた回数繰り返します。
アクションは3つの引数とともにコールバックされます。
最初の引数はマッチした文字列、2番目の引数は継承された属性、3番目はマッチしたパターンが返した属性です。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
'atLeast(0, pattern, action, init)'のショートカットです。
このメソッドの後にパターンをマッチすることはできません。
method
ParametersName | Type | Description |
---|---|---|
countmin | Number | countmin 繰り返しの最小数 |
countmax | Number | countmax 繰り返しの最大数 |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
与えられたバターンを与えられた回数繰り返します。
アクションは3つの引数とともにコールバックされます。
最初の引数はマッチした文字列、2番目の引数はマッチしたパターンが返した属性、3番目は継承された属性です。
static method
ParametersName | Type | Description |
---|---|---|
countmin | Number | countmin 繰り返しの最小数 |
countmax | Number | countmax 繰り返しの最大数 |
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().thenTimes()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
countmin | Number | countmin 繰り返しの最小数 |
countmax | Number | countmax 繰り返しの最大数 |
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | このインスタンス |
与えられたバターンを与えられた回数繰り返して属性を配列に格納します。
このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
countmin | Number | countmin 繰り返しの最小数 |
countmax | Number | countmax 繰り返しの最大数 |
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().timesArray()'のショートカットです。
static method
関数の戻り値を引数に与える関数です。
自分を再帰的に定義するときに使用します。
static method
関数の戻り値を引数に与える関数です。
自分を再帰的に定義するときに使用します。
method
ParametersName | Type | Description |
---|---|---|
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | このインスタンス |
'atLeast(0, pattern, action, init)'のショートカットです。
このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
action | Function | action 呼び出されるアクション |
init | Object | init 属性の初期値 |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().thenZeroOrMore()'のショートカットです。
method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | このインスタンス |
'atLeastArray(0, pattern, action, init)'のショートカットです。
このメソッドの後にパターンをマッチすることはできません。
static method
ParametersName | Type | Description |
---|---|---|
pattern | Object | pattern マッチさせるパターン |
Type | Description |
---|---|
Rena | 新しいインスタンス |
'Rena().zeroOrMoreArray()'のショートカットです。