In this part, the body of automaton is described.
The state is described as a rectangular which is made by characters. You can describe freely a region in the rectangular. (The region may be parsed by some parsing engines.) A character at the upper left is recognized as a meta character.
*LABEL**** * * **********
*'a label'**** * * **************
*LABEL<String>** * * ****************
************** * * **************
@LABEL@@@@ @ @ @@@@@@@@@@
*S********** =========== *new style * =old style= ************ ===========
@S@@@@@@@@@@ &&&&&&&&&&& @new style @ &old style& @@@@@@@@@@@@ &&&&&&&&&&&
*D********** * * ************
*'ArithmeticException'* * * ***********************
Characters | feature | ||||||||||||||||||||||||||||||||||||||||
- | moves left or right | ||||||||||||||||||||||||||||||||||||||||
| | moves up or down | ||||||||||||||||||||||||||||||||||||||||
+ |
branches the edge (*)Edges can only branch, not join. Notation shown as follows is illegal. **** * >-a-\ **** | **** +---> * **** | **** * >-b-/ **** |
||||||||||||||||||||||||||||||||||||||||
'...' |
specifies a label by a string which enclosed by ''. In the single quote, escape sequences(\n, \r, \t, \\, \') are available. If the label is a string, Nina translator makes an automaton fragment which recognize the string. i.e. the automaton fragment shown as follows **** **** * >--'abc'--> * **** ****is equivalent the automaton fragment shown as follows. **** **** **** **** * >--a--> >--b--> >--c--> * **** **** **** **** |
||||||||||||||||||||||||||||||||||||||||
"..." |
specifies a label by a string which enclosed by "". If builder is DFABuilder and input alphabet is char, the engine tries to match all characters of string and backtrack inputs if the engine can not match all characters. i.e. the automaton fragment shown as follows **** **** * >--"abc"--> * **** ****matches only the input "abc". And if the input would be "abd", the input "ab" would be backtracked. |
||||||||||||||||||||||||||||||||||||||||
".../lookahead" | works same as "..." but if builder is DFABuilder and input alphabet is char, the input correspond to lookahead will be unread. | ".../`lookahead-regexp`" | works same as "..." but if builder is DFABuilder and input alphabet is char, accepts if the end of inputs matched by lookahead-regexp and inputs correspond to lookahead-regexp will be unread. | ||||||||||||||||||||||||||||||||||||||
".../!lookahead" | works same as "..." but if builder is DFABuilder and input alphabet is char, accepts if the end of inputs do NOT matched by lookahead and inputs correspond to lookahead-regexp will be unread. | ||||||||||||||||||||||||||||||||||||||||
[...] |
specifies a character set.
The metacharacters are available as a character set.
|
||||||||||||||||||||||||||||||||||||||||
{...} |
invokes the subautomaton whose name is enclosed by {} subautomaton can invoke recursively, and you can describe a grammar correspond to LL(1). |
||||||||||||||||||||||||||||||||||||||||
(...) |
moves a labeled terminal which name is enclosed by () (*)The name of terminal must be one-to-one. You can not describe shown as follows. **** **** * >-a(1) (1)--> * **** **** **** (1)--> * ****You can specify a name of state as a label name. If you use a name of state as the name, the name may be one-to-many. |
||||||||||||||||||||||||||||||||||||||||
label/'...' | specifies an action if the label is transited | ||||||||||||||||||||||||||||||||||||||||
/regex/ |
specifies a label which matches by regex(GNFA) Metacharacters shown as follows are available.
The result captures in $buffer whose type is StringBuffer(Java), StringBuilder(C#), or string(JavaScript). Prefixes shows as follows are available.
|
||||||||||||||||||||||||||||||||||||||||
${name} | refers the label which is defined by #label, #define | ||||||||||||||||||||||||||||||||||||||||
$ | matches the end of input | ||||||||||||||||||||||||||||||||||||||||
. |
When the engine is NFABuilder, this matches any characters When the engine is DFABuilder, this matches the other characters |
||||||||||||||||||||||||||||||||||||||||
/ | turns the direction. You should use '+' instead of this.
|
||||||||||||||||||||||||||||||||||||||||
\ | turns the direction. You should use '+' instead of this.
|
Characters | feature |
^ |
An edge connected if the upper side of the state. An edge is connected to this state if the lower side of the state. |
v |
An edge connected if the lower side of the state. An edge is connected to this state if the upper side of the state. |
< |
An edge connected if the left side of the state. An edge is connected to this state if the right side of the state. |
> |
An edge connected if the right side of the state. An edge is connected to this state if the left side of the state. |