"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/host-java/rlparse.lm" between
ragel-7.0.0.11.tar.gz and ragel-7.0.0.12.tar.gz

About: Ragel compiles executable finite state machines from regular languages (C, C++, Obj-C, C#, D, Java, Go and Ruby). Development version.

rlparse.lm  (ragel-7.0.0.11):rlparse.lm  (ragel-7.0.0.12)
include 'ragel.lm' include 'ragel.lm'
include 'reducer.lm' include 'rlreduce.lm'
namespace inline namespace inline
lex lex
literal `fpc `fc `fcurs `ftargs literal `fpc `fc `fcurs `ftargs
`fentry `fhold `fexec `fgoto `fnext `fentry `fhold `fexec `fgoto `fnext
`fcall `fret `fbreak `fncall `fnret `fnbreak `fcall `fret `fbreak `fncall `fnret `fnbreak
token ident /ident/ token ident /ident/
token number /digit+/ token number /digit+/
token hex_number /'0x' [0-9a-fA-F]+/ token hex_number /'0x' [0-9a-fA-F]+/
skipping to change at line 102 skipping to change at line 102
token string token string
/ s_literal | d_literal / / s_literal | d_literal /
token whitespace token whitespace
/ ( [ \t] | NL )+ / / ( [ \t] | NL )+ /
token c_any / any / token c_any / any /
end end
token no_match //
def tok def tok
[no_match ident whitespace number] :ImportNum [`define whitespace ident whitespace? number] :ImportDefNum
| [no_match ident whitespace string] :ImportStr
| [no_match ident] :Else
| [`define whitespace ident whitespace? number] :ImportDefNum
| [`define whitespace ident whitespace? string] :ImportDefStr | [`define whitespace ident whitespace? string] :ImportDefStr
| [ident whitespace? `= whitespace? number] :ImportAssignNum | [ident whitespace? `= whitespace? number] :ImportAssignNum
| [ident whitespace? `= whitespace? string] :ImportAssignStr | [ident whitespace? `= whitespace? string] :ImportAssignStr
| [`define] :Def | [`define] :Def
| [`=] :Eq | [`=] :Eq
| [ident] :Ident | [ident] :Ident
| [number] :Number | [number] :Number
| [hex_number] :HexNumber | [hex_number] :HexNumber
| [comment] :Comment | [comment] :Comment
| [string] :String | [string] :String
| [whitespace] :Whitespace | [whitespace] :Whitespace
| [c_any] :Any | [c_any] :Any
{
NM: no_match = make_token( typeid<no_match>, "" )
I: ident = make_token( typeid<ident>, $lhs.c_any )
lhs = cons tok [NM I]
}
end end
reduction TopLevel reduction TopLevel
# Pass Through. # Pass Through.
# def tok # def tok
# [`define ident number] :Def1 # [`define ident number] :Def1
# | [`define ident string] :Def2 # | [`define ident string] :Def2
# | [ident `= number] :Ass1 # | [ident `= number] :Ass1
# | [ident `= string] :Ass2 # | [ident `= string] :Ass2
skipping to change at line 161 skipping to change at line 151
{ {
if ( isImport ) if ( isImport )
{ {
Literal *lit = new Literal( @number, Literal *lit = new Literal( @number,
false /* $number->neg */, $number->data, false /* $number->neg */, $number->data,
$number->length, Literal::Number ); $number->length, Literal::Number );
string name( $ident->data, $ident->length ); string name( $ident->data, $ident->length );
import( @ident, name, lit ); import( @ident, name, lit );
} }
else
{
if ( includeDepth == 0 ) {
id->curItem->data.write( "define ", 7 );
id->curItem->data.write( $ident->data, $ident->le
ngth );
id->curItem->data.write( " ", 1 );
id->curItem->data.write( $number->data, $number->
length );
}
}
} }
host::tok :ImportDefStr host::tok :ImportDefStr
{ {
if ( isImport ) if ( isImport )
{ {
Literal *lit = new Literal( @string, false, Literal *lit = new Literal( @string, false,
$string->data, $string->length, Literal:: LitString ); $string->data, $string->length, Literal:: LitString );
string name( $ident->data, $ident->length ); string name( $ident->data, $ident->length );
import( @ident, name, lit ); import( @ident, name, lit );
} }
else
{
if ( includeDepth == 0 ) {
id->curItem->data.write( "define ", 7 );
id->curItem->data.write( $ident->data, $ident->le
ngth );
id->curItem->data.write( " ", 1 );
id->curItem->data.write( $string->data, $string->
length );
}
}
} }
host::tok :ImportAssignNum host::tok :ImportAssignNum
{ {
if ( isImport ) if ( isImport )
{ {
Literal *lit = new Literal( @number, Literal *lit = new Literal( @number,
false /*$number->neg */, $number->data, false /*$number->neg */, $number->data,
$number->length, Literal::Number ); $number->length, Literal::Number );
string name( $ident->data, $ident->length ); string name( $ident->data, $ident->length );
import( @ident, name, lit ); import( @ident, name, lit );
} }
else
{
if ( includeDepth == 0 ) {
id->curItem->data.write( $ident->data, $ident->le
ngth );
id->curItem->data.write( "=", 1 );
id->curItem->data.write( $number->data, $number->
length );
}
}
} }
host::tok :ImportAssignStr host::tok :ImportAssignStr
{ {
if ( isImport ) if ( isImport )
{ {
Literal *lit = new Literal( @string, false, Literal *lit = new Literal( @string, false,
$string->data, $string->length, Literal:: LitString ); $string->data, $string->length, Literal:: LitString );
string name( $ident->data, $ident->length ); string name( $ident->data, $ident->length );
import( @ident, name, lit ); import( @ident, name, lit );
} }
else
{
if ( includeDepth == 0 ) {
id->curItem->data.write( $ident->data, $ident->le
ngth );
id->curItem->data.write( "=", 1 );
id->curItem->data.write( $string->data, $string->
length );
}
}
}
host::tok :Def
{
if ( !isImport && includeDepth == 0 )
id->curItem->data.write( "define", 6 );
}
host::tok :Eq
{
if ( !isImport && includeDepth == 0 )
id->curItem->data.write( "=", 1 );
}
host::tok :Ident
{
if ( !isImport && includeDepth == 0 )
id->curItem->data.write( $ident->data, $ident->length );
}
host::tok :Number
{
if ( !isImport && includeDepth == 0 )
id->curItem->data.write( $number->data, $number->length )
;
}
host::tok :HexNumber
{
if ( !isImport && includeDepth == 0 )
id->curItem->data.write( $hex_number->data, $hex_number->
length );
}
host::tok :Comment
{
if ( !isImport && includeDepth == 0 )
id->curItem->data.write( $comment->data, $comment->length
);
}
host::tok :String
{
if ( !isImport && includeDepth == 0 )
id->curItem->data.write( $string->data, $string->length )
;
}
host::tok :Whitespace
{
if ( !isImport && includeDepth == 0 )
id->curItem->data.write( $whitespace->data, $whitespace->
length );
}
host::tok :Any
{
if ( !isImport && includeDepth == 0 )
id->curItem->data.write( $c_any->data, $c_any->length );
}
host::tok :Else
{
if ( !isImport && includeDepth == 0 )
id->curItem->data.write( $ident->data, $ident->length );
}
host::section :MultiLine
{
if ( !isImport && includeDepth == 0 ) {
InputItem *inputItem = new InputItem;
inputItem->type = InputItem::EndSection;
inputItem->loc = @5;
id->inputItems.append( inputItem );
if ( section != 0 ) {
inputItem->section = section;
section->lastReference = inputItem;
}
/* The end section may include a newline on the end, so
* we use the last line, which will count the newline. */
inputItem = new InputItem;
inputItem->type = InputItem::HostData;
inputItem->loc = @5;
if ( inputItem->loc.fileName == 0 )
inputItem->loc = @1;
id->inputItems.append( inputItem );
/* Record the parse data and move over the end section. *
/
id->curItem = id->curItem->next;
id->curItem->pd = pd;
/* Move over the host data. */
id->curItem = id->curItem->next;
}
} }
end end
export RagelError: str export RagelError: str
# File name. The open is expected to succeed. It is tested before the colm # File name. The open is expected to succeed. It is tested before the colm
# program is called. # program is called.
A: list_el<str> = argv->pop_head_el() A: list_el<str> = argv->pop_head_el()
GblFileName = A->value GblFileName = A->value
 End of changes. 8 change blocks. 
150 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)