From: helly Date: Thu, 14 Feb 2008 19:04:01 +0000 (+0000) Subject: - Update docu X-Git-Tag: 0.13.6~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a5bc4d123a6a99a58db052dbad2ed96c599b70b;p=re2c - Update docu --- diff --git a/re2c/htdocs/manual.html b/re2c/htdocs/manual.html index 7ee99c2c..26cd68ca 100755 --- a/re2c/htdocs/manual.html +++ b/re2c/htdocs/manual.html @@ -275,20 +275,34 @@ tweaked using inplace configurations "state:abort" and "state:nextlabel".

SCANNER WITH CONDITION SUPPORT

You can preceed regular-expressions with a list of condition names when using the -c -switch. In this case re2c generates scanner blocks for each conditon. Each of the +switch. In this case re2c generates scanner blocks for each conditon. Where each of the generated scanners has its own precondition. The precondition is given by the interface define YYGETCONDITON and must be of type YYCONDTYPE.

-There are two special rule types. First the rules of the condition '*' are +There are two special rule types. First, the rules of the condition '*' are merged to all conditions. And second the empty condition list allows to provide a code block that does not have a scanner part. Meaning it does not allow any regular expression. The condition value referring to this special -block is always the one with the enumeration value 0. +block is always the one with the enumeration value 0. This way the code of this +special rule can be used to initialize a scanner. It is in no way necessary to +have these rules: but sometimes it is helpful to have a dedicated uninitialized +condition state.

Non empty rules allow to specify the new condition, which makes them transition rules. Besides generating calls for the define YYSETCONDTITION no other special code is generated.

+

+There is another kind of special rules that allow to prepend code to any code +block of all rules of a certain set of conditions or to all code blocks to all +rules. This can be helpful when some operation is common among rules. For +instance this can be used to store the length of the scanned string. These +special prefix rules start with an exclamation mark followed by either a list +of conditions <! condition, ... > or a star <!*>. +When re2c generates the code for a rule whose state does not have a +prefix rule and a star'd prefix rule is present, than that code will be used +as prefix code. +

 

SCANNER SPECIFICATIONS

Each scanner specification consists of a set of rules, named diff --git a/re2c/re2c.1.in b/re2c/re2c.1.in index 3c56dd52..8b969d27 100644 --- a/re2c/re2c.1.in +++ b/re2c/re2c.1.in @@ -317,20 +317,32 @@ tweaked using inplace configurations "\fBstate:abort\fP" and "\fBstate:nextlabel .SH "SCANNER WITH CONDITION SUPPORT" You can preceed \*(rxs with a list of condition names when using the \fB-c\fP -switch. In this case \*(re generates scanner blocks for each conditon. Each of the +switch. In this case \*(re generates scanner blocks for each conditon. Where each of the generated blocks has its own precondition. The precondition is given by the interface define \fBYYGETCONDITON\fP and must be of type \fBYYCONDTYPE\fP. .LP -There are two special rule types. First the rules of the condition '*' are +There are two special rule types. First, the rules of the condition '*' are merged to all conditions. And second the empty condition list allows to provide a code block that does not have a scanner part. Meaning it does not allow any regular expression. The condition value referring to this special -block is always the one with the enumeration value 0. +block is always the one with the enumeration value 0. This way the code of this +special rule can be used to initialize a scanner. It is in no way necessary to +have these rules: but sometimes it is helpful to have a dedicated uninitialized +condition state. .LP Non empty rules allow to specify the new condition, which makes them transition rules. Besides generating calls for the define \fBYYSETCONDTITION\fP no other special code is generated. - +.LP +There is another kind of special rules that allow to prepend code to any code +block of all rules of a certain set of conditions or to all code blocks to all +rules. This can be helpful when some operation is common among rules. For +instance this can be used to store the length of the scanned string. These +special prefix rules start with an exclamation mark followed by either a list +of conditions \fB\fP or a star \fB\fP. +When \*(re generates the code for a rule whose state does not have a +prefix rule and a star'd prefix rule is present, than that code will be used +as prefix code. .SH "SCANNER SPECIFICATIONS" Each scanner specification consists of a set of \fIrules\fP, \fInamed