青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

woaidongmao

文章均收錄自他人博客,但不喜標(biāo)題前加-[轉(zhuǎn)貼],因其丑陋,見諒!~
隨筆 - 1469, 文章 - 0, 評論 - 661, 引用 - 0
數(shù)據(jù)加載中……

Ragel man page(英)

ragel - compile regular languages into executable state machines

Synopsis

ragel [options] file

Description

Ragel compiles executable finite state machines from regular languages. Ragel can generate C, C++, Objective-C, D, or Java code. Ragel state machines can not only recognize byte sequences as regular expression machines do, but can also execute code at arbitrary points in the recognition of a regular language. User code is embedded using inline operators that do not disrupt the regular language syntax.

The core language consists of standard regular expression operators, such as union, concatenation and kleene star, accompanied by action embedding operators. Ragel also provides operators that let you control any non-determinism that you create, construct scanners using the longest match paradigm, and build state machines using the statechart model. It is also possible to influence the execution of a state machine from inside an embedded action by jumping or calling to other parts of the machine and reprocessing input.

Ragel provides a very flexibile interface to the host language that attempts to place minimal restrictions on how the generated code is used and integrated into the application. The generated code has no dependencies.

Options

-h, -H, -?, --help

Display help and exit.

-v

Print version information and exit.

-o " file"

Write output to file. If -o is not given, a default file name is chosen by replacing the suffix of the input. For source files ending in .rh the suffix .h is used. For all other source files a suffix based on the output language is used (.c, .cpp, .m, .dot)

-s

Print some statistics on standard error.

-n

Do not perform state minimization.

-m

Perform minimization once, at the end of the state machine compilation.

-l

Minimize after nearly every operation. Lists of like operations such as unions are minimized once at the end. This is the default minimization option.

-e

Minimize after every operation.

-x

Run the frontend only: emit XML intermediate format.

-V

Generate a dot file for Graphviz.

-p

Display printable characters on labels.

-S <spec>

FSM specification to output

-M <machine>

Machine definition/instantiation to output

-C

The host language is C, C++, Obj-C or Obj-C++. This is the default host language option.

-D

The host language is D.

-J

The host language is Java.

-R

The host language is Ruby.

-L

Inhibit writing of #line directives.

-T0

Table driven FSM (default).

-T1

Faster table driven FSM.

-F0

Flat table driven FSM.

-F1

Faster flat table-driven FSM.

-G0

Goto-driven FSM.

-G1

Faster goto-driven FSM.

-G2

Really fast goto-driven FSM.

-P<N>

N-Way Split really fast goto-driven FSM.

Ragel Input

NOTE: This is a very brief description of Ragel input. Ragel is described in more detail in the user guide available from the homepage (see below).

Ragel normally passes input files straight to the output. When it sees an FSM specification that contains machine instantiations it stops to generate the state machine. If there are write statements (such as "write exec") then ragel emits the corresponding code. There can be any number of FSM specifications in an input file. A multi-line FSM specification starts with '%%{' and ends with '}%%'. A single line FSM specification starts with %% and ends at the first newline.

Fsm Statements

Machine Name:

Set the the name of the machine. If given, it must be the first statement.

Alphabet Type:

Set the data type of the alphabet.

GetKey:

Specify how to retrieve the alphabet character from the element type.

Include:

Include a machine of same name as the current or of a different name in either the current file or some other file.

Action Definition:

Define an action that can be invoked by the FSM.

Fsm Definition, Instantiation and Longest Match Instantiation:

Used to build FSMs. Syntax description in next few sections.

Access:

Specify how to access the persistent state machine variables.

Write:

Write some component of the machine.

Variable:

Override the default variable names (p, pe, cs, act, etc).

Basic Machines

The basic machines are the base operands of the regular language expressions.

'hello'

Concat literal. Produces a concatenation of the characters in the string. Supports escape sequences with '\'. The result will have a start state and a transition to a new state for each character in the string. The last state in the sequence will be made final. To make the string case-insensitive, append an 'i' to the string, as in 'cmd'i.

dqhellodq

Identical to single quote version.

[hello]

Or literal. Produces a union of characters. Supports character ranges with '-', negating the sense of the union with an initial '^' and escape sequences with '\'. The result will have two states with a transition between them for each character or range.

NOTE: '', "", and [] produce null FSMs. Null machines have one state that is both a start state and a final state and match the zero length string. A null machine may be created with the null builtin machine.

integer

Makes a two state machine with one transition on the given integer number.

hex

Makes a two state machine with one transition on the given hexidecimal number.

/simple_regex/

A simple regular expression. Supports the notation '.', '*' and '[]', character ranges with '-', negating the sense of an OR expression with and initial '^' and escape sequences with '\'. Also supports one trailing flag: i. Use it to produce a case-insensitive regular expression, as in /GET/i.

lit .. lit

Specifies a range. The allowable upper and lower bounds are concat literals of length one and number machines. For example, 0x10..0x20, 0..63, and 'a'..'z' are valid ranges.

variable_name

References the machine definition assigned to the variable name given.

builtin_machine

There are several builtin machines available. They are all two state machines for the purpose of matching common classes of characters. They are:

any

Any character in the alphabet.

ascii

Ascii characters 0..127.

extend

Ascii extended characters. This is the range -128..127 for signed alphabets and the range 0..255 for unsigned alphabets.

alpha

Alphabetic characters /[A-Za-z]/.

digit

Digits /[0-9]/.

alnum

Alpha numerics /[0-9A-Za-z]/.

lower

Lowercase characters /[a-z]/.

upper

Uppercase characters /[A-Z]/.

xdigit

Hexidecimal digits /[0-9A-Fa-f]/.

cntrl

Control characters 0..31.

graph

Graphical characters /[!-~]/.

print

Printable characters /[ -~]/.

punct

Punctuation. Graphical characters that are not alpha-numerics /[!-/:-@\[-'{-~]/.

space

Whitespace /[\t\v\f\n\r ]/.

null

Zero length string. Equivalent to '', "" and [].

empty

Empty set. Matches nothing.

Brief Operator Reference

Operators are grouped by precedence, group 1 being the lowest and group 6 the highest.

GROUP 1:

expr , expr

Join machines together without drawing any transitions, setting up a start state or any final states. Start state must be explicitly specified with the "start" label. Final states may be specified with the an epsilon transitions to the implicitly created "final" state.

GROUP 2:

expr | expr

Produces a machine that matches any string in machine one or machine two.

expr & expr

Produces a machine that matches any string that is in both machine one and machine two.

expr - expr

Produces a machine that matches any string that is in machine one but not in machine two.

expr -- expr

Strong Subtraction. Matches any string in machine one that does not have any string in machine two as a substring.

GROUP 3:

expr . expr

Produces a machine that matches all the strings in machine one followed by all the strings in machine two.

expr :> expr

Entry-Guarded Concatenation: terminates machine one upon entry to machine two.

expr :>> expr

Finish-Guarded Concatenation: terminates machine one when machine two finishes.

expr <: expr

Left-Guarded Concatenation: gives a higher priority to machine one.

NOTE: Concatenation is the default operator. Two machines next to each other with no operator between them results in the concatenation operation.

GROUP 4:

label: expr

Attaches a label to an expression. Labels can be used by epsilon transitions and fgoto and fcall statements in actions. Also note that the referencing of a machine definition causes the implicit creation of label by the same name.

GROUP 5:

expr -> label

Draws an epsilon transition to the state defined by label. Label must be a name in the current scope. Epsilon transitions are resolved when comma operators are evaluated and at the root of the expression tree of machine assignment/instantiation.

GROUP 6: Actions

An action may be a name predefined with an action statement or may be specified directly with '{' and '}' in the expression.

expr > action

Embeds action into starting transitions.

expr @ action

Embeds action into transitions that go into a final state.

expr $ action

Embeds action into all transitions. Does not include pending out transitions.

expr % action

Embeds action into pending out transitions from final states.

GROUP 6: EOF Actions

When a machine's finish routine is called the current state's EOF actions are executed.

expr >/ action

Embed an EOF action into the start state.

expr </ action

Embed an EOF action into all states except the start state.

expr $/ action

Embed an EOF action into all states.

expr %/ action

Embed an EOF action into final states.

expr @/ action

Embed an EOF action into all states that are not final.

expr <>/ action

Embed an EOF action into all states that are not the start state and that are not final (middle states).

GROUP 6: Global Error Actions

Global error actions are stored in states until the final state machine has been fully constructed. They are then transferred to error transitions, giving the effect of a default action.

expr >! action

Embed a global error action into the start state.

expr <! action

Embed a global error action into all states except the start state.

expr $! action

Embed a global error action into all states.

expr %! action

Embed a global error action into the final states.

expr @! action

Embed a global error action into all states which are not final.

expr <>! action

Embed a global error action into all states which are not the start state and are not final (middle states).

GROUP 6: Local Error Actions

Local error actions are stored in states until the named machine is fully constructed. They are then transferred to error transitions, giving the effect of a default action for a section of the total machine. Note that the name may be omitted, in which case the action will be transferred to error actions upon construction of the current machine.

expr >^ action

Embed a local error action into the start state.

expr <^ action

Embed a local error action into all states except the start state.

expr $^ action

Embed a local error action into all states.

expr %^ action

Embed a local error action into the final states.

expr @^ action

Embed a local error action into all states which are not final.

expr <>^ action

Embed a local error action into all states which are not the start state and are not final (middle states).

GROUP 6: To-State Actions

To state actions are stored in states and executed any time the machine moves into a state. This includes regular transitions, and transfers of control such as fgoto. Note that setting the current state from outside the machine (for example during initialization) does not count as a transition into a state.

expr >~ action

Embed a to-state action action into the start state.

expr <~ action

Embed a to-state action into all states except the start state.

expr $~ action

Embed a to-state action into all states.

expr %~ action

Embed a to-state action into the final states.

expr @~ action

Embed a to-state action into all states which are not final.

expr <>~ action

Embed a to-state action into all states which are not the start state and are not final (middle states).

GROUP 6: From-State Actions

From state actions are executed whenever a state takes a transition on a character. This includes the error transition and a transition to self.

expr >* action

Embed a from-state action into the start state.

expr <* action

Embed a from-state action into every state except the start state.

expr $* action

Embed a from-state action into all states.

expr %* action

Embed a from-state action into the final states.

expr @* action

Embed a from-state action into all states which are not final.

expr <>* action

Embed a from-state action into all states which are not the start state and are not final (middle states).

GROUP 6: Priority Assignment

Priorities are assigned to names within transitions. Only priorities on the same name are allowed to interact. In the first form of priorities the name defaults to the name of the machine definition the priority is assigned in. Transitions do not have default priorities.

expr > int

Assigns the priority int in all transitions leaving the start state.

expr @ int

Assigns the priority int in all transitions that go into a final state.

expr $ int

Assigns the priority int in all existing transitions.

expr % int

Assigns the priority int in all pending out transitions.

A second form of priority assignment allows the programmer to specify the name to which the priority is assigned, allowing interactions to cross machine definition boundaries.

expr > (name,int)

Assigns the priority int to name in all transitions leaving the start state.

expr @ (name, int)

Assigns the priority int to name in all transitions that go into a final state.

expr $ (name, int)

Assigns the priority int to name in all existing transitions.

expr % (name, int)

Assigns the priority int to name in all pending out transitions.

GROUP 7:

expr *

Produces the kleene star of a machine. Matches zero or more repetitions of the machine.

expr **

Longest-Match Kleene Star. This version of kleene star puts a higher priority on staying in the machine over wrapping around and starting over. This operator is equivalent to ( ( expr ) $0 %1 )*.

expr ?

Produces a machine that accepts the machine given or the null string. This operator is equivalent to ( expr | '' ).

expr +

Produces the machine concatenated with the kleen star of itself. Matches one or more repetitions of the machine. This operator is equivalent to ( expr . expr* ).

expr {n}

Produces a machine that matches exactly n repetitions of expr.

expr {,n}

Produces a machine that matches anywhere from zero to n repetitions of expr.

expr {n,}

Produces a machine that matches n or more repetitions of expr.

expr {n,m}

Produces a machine that matches n to m repetitions of expr.

GROUP 8:

! expr

Produces a machine that matches any string not matched by the given machine. This operator is equivalent to ( *extend - expr ).

^ expr

Character-Level Negation. Matches any single character not matched by the single character machine expr.

GROUP 9:

( expr )

Forces precedence on operators.

Values Available in Code Blocks

fc

The current character. Equivalent to *p.

fpc

A pointer to the current character. Equivalent to p.

fcurs

An integer value representing the current state.

ftargs

An integer value representing the target state.

fentry(<label>)

An integer value representing the entry point <label>.

Statements Available in Code Blocks

fhold;

Do not advance over the current character. Equivalent to --p;.

fexec <expr>;

Sets the current character to something else. Equivalent to p = (<expr>)-1;

fgoto <label>;

Jump to the machine defined by <label>.

fgoto *<expr>;

Jump to the entry point given by <expr>. The expression must evaluate to an integer value representing a state.

fnext <label>;

Set the next state to be the entry point defined by <label>. The fnext statement does not immediately jump to the specified state. Any action code following the statement is executed.

fnext *<expr>;

Set the next state to be the entry point given by <expr>. The expression must evaluate to an integer value representing a state.

fcall <label>;

Call the machine defined by <label>. The next fret will jump to the target of the transition on which the action is invoked.

fcall *<expr>;

Call the entry point given by <expr>. The next fret will jump to the target of the transition on which the action is invoked.

fret;

Return to the target state of the transition on which the last fcall was made.

fbreak;

Save the current state and immediately break out of the machine.

Bugs

Ragel is still under development and has not yet matured. There are probably many bugs.

Credits

Ragel was written by Adrian Thurston <thurston@cs.queensu.ca>. Objective-C output contributed by Erich Ocean. D output contributed by Alan West.

posted on 2008-12-28 00:08 肥仔 閱讀(469) 評論(0)  編輯 收藏 引用 所屬分類: 狀態(tài)機 & 自動機 & 形式語言

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲福利专区| 中国成人黄色视屏| 欧美亚洲三区| 9国产精品视频| 欧美一级二区| 亚洲免费一区二区| 午夜日韩在线观看| 久久国产欧美| 另类人畜视频在线| 亚洲电影下载| 亚洲电影在线免费观看| 亚洲三级影片| 亚洲欧美日韩国产精品| 久久久精品免费视频| 欧美成人国产一区二区| 欧美日韩久久| 国产在线视频不卡二| 亚洲激情第一区| 亚洲一级黄色| 麻豆成人在线观看| av72成人在线| 麻豆精品传媒视频| 亚洲欧美国产精品桃花| 久久激情中文| 欧美日韩国产高清视频| 国产亚洲欧美另类中文| 亚洲国产精品成人精品| 午夜精品国产| 亚洲人成艺术| 国产精品久久久久久久一区探花| 亚洲女与黑人做爰| 久久久青草婷婷精品综合日韩| 亚洲免费影视第一页| 久久婷婷麻豆| 久久婷婷国产麻豆91天堂| 亚洲国产一区在线| 久久激情五月激情| 国产精品亚洲а∨天堂免在线| 欧美裸体一区二区三区| 久久久天天操| 久久精品亚洲乱码伦伦中文| 欧美极品影院| 欧美高清视频| 韩日在线一区| 午夜精品亚洲| 亚洲日本精品国产第一区| 久久av免费一区| 国产精品理论片| 日韩视频精品在线观看| 欧美夫妇交换俱乐部在线观看| 免费成人黄色片| 亚洲欧美国产精品va在线观看 | 午夜精品成人在线| 中文在线不卡| 亚洲国产成人av好男人在线观看| 欧美激情精品久久久六区热门| 毛片精品免费在线观看| 亚洲欧美日韩精品在线| 国产精品久久久久久户外露出 | 亚洲午夜91| 欧美日本高清视频| 99精品国产热久久91蜜凸| 亚洲欧洲日韩在线| 久久综合影音| 久久久一本精品99久久精品66| 欧美激情精品久久久久久大尺度| 欧美激情视频在线播放| 欧美日韩国产亚洲一区| 日韩一级黄色大片| 亚洲精品在线视频观看| 欧美日韩成人一区二区| 国产亚洲激情在线| 久久成人精品一区二区三区| 久久不射网站| 亚洲区第一页| 一区二区免费在线视频| 国产精品一区二区久久| 久久久久久久综合| 久久久久国产精品一区二区| 亚洲二区在线观看| 99国产成+人+综合+亚洲欧美| 欧美激情视频一区二区三区在线播放| 欧美日韩另类视频| 亚洲一区日本| 欧美在线一区二区三区| 亚洲国产成人91精品| 亚洲日韩视频| 国产日韩欧美在线视频观看| 美女网站久久| 国产精品jvid在线观看蜜臀 | 日韩视频免费在线观看| 亚洲人永久免费| 国产女主播在线一区二区| 免费观看30秒视频久久| 欧美日韩久久不卡| 久久一区激情| 国产精品v一区二区三区| 久久夜色精品| 欧美性猛交99久久久久99按摩 | 日韩亚洲精品在线| 久久久久.com| 欧美高潮视频| 久久免费高清视频| 欧美日韩情趣电影| 裸体丰满少妇做受久久99精品| 这里只有精品视频| 欧美日韩国产经典色站一区二区三区| 狠狠狠色丁香婷婷综合激情| 亚洲大片精品永久免费| 国产噜噜噜噜噜久久久久久久久| 亚洲免费观看| 欧美在线观看www| 欧美日韩一区二区在线观看| 久久精品免费播放| 欧美人与性动交a欧美精品| 精品1区2区| 亚洲视频专区在线| 亚洲精品国产欧美| 欧美一区在线视频| 亚洲自拍偷拍色片视频| 美女视频一区免费观看| 久久精品电影| 国产精品xxxxx| 欧美激情精品久久久久久大尺度| 欧美一区影院| 欧美亚洲午夜视频在线观看| 久久三级视频| 久久婷婷av| 国产一区二区0| 亚洲欧美资源在线| 久久精品视频免费播放| 亚洲午夜精品国产| 在线成人国产| 激情视频亚洲| 欧美中文字幕久久| 欧美成人黑人xx视频免费观看| 先锋影音久久| 亚洲免费一在线| 亚洲特黄一级片| 一本色道久久综合亚洲91| 欧美成人免费在线| 男女av一区三区二区色多| 久久久久久亚洲精品不卡4k岛国| 性欧美videos另类喷潮| 国产日产亚洲精品| 欧美一区观看| 欧美天堂亚洲电影院在线播放| 亚洲欧美综合国产精品一区| 欧美日韩免费视频| 宅男66日本亚洲欧美视频| 亚洲欧美中日韩| 国产亚洲欧美一区| 亚洲国产第一页| 亚洲精品久久久久| 亚洲桃花岛网站| 欧美在线你懂的| 黑人巨大精品欧美一区二区| 久久先锋影音av| 亚洲欧洲日本一区二区三区| 一区二区三区四区国产| 国产精品毛片在线看| 欧美在线关看| 亚洲国内在线| 欧美亚洲综合网| 亚洲国产精品久久久久婷婷老年 | 国产精品久99| 午夜精品久久久久久99热| 久久精品国产第一区二区三区| 欧美韩日高清| 在线综合亚洲欧美在线视频| 久久精品在线免费观看| 伊人久久综合| 一区二区三区日韩欧美精品| 在线免费精品视频| 蜜臀av一级做a爰片久久| 亚洲精品乱码久久久久久按摩观| 国产精品久久久久久亚洲调教| 欧美国产日韩亚洲一区| 欧美视频观看一区| 欧美在线亚洲综合一区| 亚洲第一综合天堂另类专| 国产日韩欧美三级| 欧美高清视频一区二区三区在线观看| 亚洲影院色无极综合| 欧美成人国产va精品日本一级| 欧美一区二区三区四区高清| 精品成人a区在线观看| 欧美三级午夜理伦三级中视频| 91久久在线视频| 久久久999成人| 亚洲综合日韩在线| 国产精品久久久久久久久借妻| 亚洲乱码日产精品bd| 久久天天躁狠狠躁夜夜av| 欧美激情视频一区二区三区免费 | 亚洲一区精品视频| 欧美国产日韩精品| 久久久国产成人精品| 亚洲午夜精品国产| 亚洲精品一区在线观看|