adrian-thurston / ragel Goto Github PK
View Code? Open in Web Editor NEWRagel State Machine Compiler
License: MIT License
Ragel State Machine Compiler
License: MIT License
This way we can add a ragel state machine to a C file without disrupting the C syntax. The resulting file can still be handled as a C (or whichever) language by the IDE.
http://www.colm.net/pipermail/ragel-users/2019-April/003622.html
from twitter user thatnumbersguy_
This has been requested in the past. Requested again by Denis Naumov.
%%option name = value;
There are some sticky issues involved ... how to parse the host language to discover what language we are to parse?
This would be useful for setting the state outside of the machine. Still needed :)
Right now the only way to get an action to execute before a condition is to use from-state actions. Would be better if we can sequence these using ordering in the ragel source code. This comes up when we want to initialize a variable referenced by a condition. For example, when counting things we need to use from-state actions to get the variable referenced by the condition initialized. Would be better if we could:
Currently a transition list is just two levels, with actions embedable only at the second level (after condition tested and transition selected). Maybe this implies an arbitrary number of levels. Or maybe we just want a syntax for putting actions in the top level, keeping the same structure. If we go that route then we can have just one kind of action list:
'foo' >action >cond >action
Anything before the cond goes into the top leve, anything after goes into the second level.
Need to work something out here, otherwise we are stuck with using leaving actions (something of a hack).
I am trying to resolve a simple non-determinism.
%%{
machine query;
# An application/x-www-form-urlencoded parser based on the
definition by WhatWG.
# Based on https://url.spec.whatwg.org/#application/x-www-form-urlencoded
pchar = any - [&=\[\]];
# All transitions default to priority 0. We set the integer exit
priority to 1, which ensures a transition to the next state will only
invoke %integer_end (the lower priority %string_end transition is
discarded).
integer = ([0-9]+) %(index, 1) >integer_begin %integer_end;
string = (pchar+) $(index, 0) >string_begin %string_end;
value = (pchar*) >value_begin %value_end;
index = string (
'[' (integer | string) ']'
)* ('[]' %append)?;
pair = (
index ('=' value)?
) %pair;
main := ((pair '&')* pair)?;
}%%
When parsing the following input: q[0]=0
I see that on the transition for ]
it will invoke both %integer_end
as well as %string_end
. But I was under the impression the lower priority transition would be dropped.
Thanks for any advice you can give me.
This separation was present because of the intermediate XML file. With the XML file gone it doesn't make much sense to separate into producer and consumer.
Due to a bug there is a type that is too small (reported by Atilla). Should just use int since size does not matter.
Not sure if these work ... needs some investiationg.
Notably NFA is the first time generated code makes use of a record.
Zig is currently lacking a composable parsing system.
I'm not sure if ragel is the right answer, compared to e.g. a PEG system in the standard library.
Maybe?
RE: Dec 22, 2009 mailing list message from Andrew Dalke
I found some problem with generated files on Windows platform.
if *.rl file is utf-8 file with signature (first 2 bytes EF BB).
Example:
input file lexer.rl ----- START --------------- //=== this is first line (comment) ... // other lines ----- END --------------- output file lexer.cs ----- START --------------- /* #line 1 "lexer.rl" */ ?//=== this is first line (comment) ... // other lines ----- END ---------------
ragel puts /* #line 1 "lexer.rl" */ comment before utf-8 signature at
the begining of file and this is wrong utf-8 file.
And second - if we disable #line generation with option -L, you remove
generation /* #line */ - not just comment this lines.
Best regards,
Denis Naumov.
Cannot use -Wl,--no-undefined
http://www.colm.net/pipermail/ragel-users/2018-December/003584.html
Error reported wrong due to stream push/pull/reparse.
[thurston@railay] ragel.d: /home/thurston/devel/colm-suite/ragel/host-go/ragel-go -I. -T0 -o working/fbreak1_T0.go working/fbreak1.rl working/fbreak1.rl:13:9: parse error message: warning: lost trees: 1 message: warning: lost heads: 1
these are not drawn in such a way to reflect when they are actually exectued, they just get glued onto the action list for the transition
I've hit what appears to be a bug in ragel. As part of a larger machine, I've built a string parser that interprets "bare" strings (i.e. not enclosed within quotes).
The two-character start sequence check exists because there are valid sequences that begin with a character, followed by a symbol (such as u"
). The rest of the machine is omitted from this test code for brevity.
The problem is that the generated code causes an index-out-of-bounds error. I've distilled the issue down to this test code:
package ragelbug
import (
"fmt"
)
%%{
machine ragelbug;
ws = [\r\n\t ];
unquoted_first_char = [A-Za-z_];
unquoted_second_char = unquoted_first_char | [0-9];
unquoted_remaining_char = [0-9A-Za-z_];
unquoted_string = unquoted_first_char unquoted_second_char @{
fcall unquoted_string_iterate;
};
unquoted_string_iterate := unquoted_remaining_char* %{
if err = callbacks.OnArrayData(data[arrayStart:fpc]); err != nil {
fbreak;
}
if err = callbacks.OnArrayEnd(); err != nil {
fbreak;
}
firstTwoCharacters = firstTwoCharacters[:0]
fret;
};
main := unquoted_string ws* @/{
err = fmt.Errorf("Incomplete document")
};
}%%
%% write data;
type ArrayType int
const (
ArrayTypeBinary = ArrayType(iota)
ArrayTypeString
)
type DecoderCallbacks interface {
OnArrayBegin(arrayType ArrayType) error
OnArrayData(bytes []byte) error
OnArrayEnd() error
}
func Parse(data []byte, callbacks DecoderCallbacks) (err error) {
cs := 0
p := 0
pe := len(data)
eof := pe
top := 0
stack := make([]int, 100)
firstTwoCharacters := make([]byte, 0, 8)
arrayStart := 0
_ = eof
%%{
write init;
write exec;
}%%
if cs == ragelbug_error {
err = fmt.Errorf("Parse error at %v", p)
}
return
}
//line decoder.rl:1
package ragelbug
import (
"fmt"
)
//line decoder.rl:36
//line decoder.go:16
var _ragelbug_actions []byte = []byte{
0, 1, 0, 1, 1,
}
var _ragelbug_key_offsets []byte = []byte{
0, 0, 5, 12, 16,
}
var _ragelbug_trans_keys []byte = []byte{
95, 65, 90, 97, 122, 95, 48, 57,
65, 90, 97, 122, 13, 32, 9, 10,
95, 48, 57, 65, 90, 97, 122,
}
var _ragelbug_single_lengths []byte = []byte{
0, 1, 1, 2, 1,
}
var _ragelbug_range_lengths []byte = []byte{
0, 2, 3, 1, 3,
}
var _ragelbug_index_offsets []byte = []byte{
0, 0, 4, 9, 13,
}
var _ragelbug_indicies []byte = []byte{
0, 0, 0, 1, 2, 2, 2, 2,
1, 3, 3, 3, 1, 4, 4, 4,
4, 1,
}
var _ragelbug_trans_targs []byte = []byte{
2, 0, 3, 3, 4,
}
var _ragelbug_trans_actions []byte = []byte{
0, 0, 1, 0, 0,
}
var _ragelbug_eof_actions []byte = []byte{
0, 0, 0, 0, 3,
}
const ragelbug_start int = 1
const ragelbug_first_final int = 3
const ragelbug_error int = 0
const ragelbug_en_unquoted_string_iterate int = 4
const ragelbug_en_main int = 1
//line decoder.rl:40
type ArrayType int
const (
ArrayTypeBinary = ArrayType(iota)
ArrayTypeString
)
type DecoderCallbacks interface {
OnArrayBegin(arrayType ArrayType) error
OnArrayData(bytes []byte) error
OnArrayEnd() error
}
func Parse(data []byte, callbacks DecoderCallbacks) (err error) {
cs := 0
p := 0
pe := len(data)
eof := pe
top := 0
stack := make([]int, 100)
firstTwoCharacters := make([]byte, 0, 8)
arrayStart := 0
_ = eof
//line decoder.go:95
{
cs = ragelbug_start
top = 0
}
//line decoder.go:101
{
var _klen int
var _trans int
var _acts int
var _nacts uint
var _keys int
if p == pe {
goto _test_eof
}
if cs == 0 {
goto _out
}
_resume:
_keys = int(_ragelbug_key_offsets[cs])
_trans = int(_ragelbug_index_offsets[cs])
_klen = int(_ragelbug_single_lengths[cs])
if _klen > 0 {
_lower := int(_keys)
var _mid int
_upper := int(_keys + _klen - 1)
for {
if _upper < _lower {
break
}
_mid = _lower + ((_upper - _lower) >> 1)
switch {
case data[p] < _ragelbug_trans_keys[_mid]:
_upper = _mid - 1
case data[p] > _ragelbug_trans_keys[_mid]:
_lower = _mid + 1
default:
_trans += int(_mid - int(_keys))
goto _match
}
}
_keys += _klen
_trans += _klen
}
_klen = int(_ragelbug_range_lengths[cs])
if _klen > 0 {
_lower := int(_keys)
var _mid int
_upper := int(_keys + (_klen << 1) - 2)
for {
if _upper < _lower {
break
}
_mid = _lower + (((_upper - _lower) >> 1) & ^1)
switch {
case data[p] < _ragelbug_trans_keys[_mid]:
_upper = _mid - 2
case data[p] > _ragelbug_trans_keys[_mid + 1]:
_lower = _mid + 2
default:
_trans += int((_mid - int(_keys)) >> 1)
goto _match
}
}
_trans += _klen
}
_match:
_trans = int(_ragelbug_indicies[_trans])
cs = int(_ragelbug_trans_targs[_trans])
if _ragelbug_trans_actions[_trans] == 0 {
goto _again
}
_acts = int(_ragelbug_trans_actions[_trans])
_nacts = uint(_ragelbug_actions[_acts]); _acts++
for ; _nacts > 0; _nacts-- {
_acts++
switch _ragelbug_actions[_acts-1] {
case 0:
//line decoder.rl:18
stack[top] = cs; top++; cs = 4; goto _again
//line decoder.go:186
}
}
_again:
if cs == 0 {
goto _out
}
p++
if p != pe {
goto _resume
}
_test_eof: {}
if p == eof {
__acts := _ragelbug_eof_actions[cs]
__nacts := uint(_ragelbug_actions[__acts]); __acts++
for ; __nacts > 0; __nacts-- {
__acts++
switch _ragelbug_actions[__acts-1] {
case 1:
//line decoder.rl:22
if err = callbacks.OnArrayData(data[arrayStart:p]); err != nil {
p++; goto _out
}
if err = callbacks.OnArrayEnd(); err != nil {
p++; goto _out
}
firstTwoCharacters = firstTwoCharacters[:0]
top--; cs = stack[top]
goto _again
//line decoder.go:221
}
}
}
_out: {}
}
//line decoder.rl:67
if cs == ragelbug_error {
err = fmt.Errorf("Parse error at %v", p)
}
return
}
package ragelbug
import (
"fmt"
"testing"
)
type testCallbacks struct {
Value interface{}
currentArray []byte
currentArrayType ArrayType
}
func (this *testCallbacks) OnArrayBegin(arrayType ArrayType) error {
this.currentArray = make([]byte, 0, 100)
this.currentArrayType = arrayType
return nil
}
func (this *testCallbacks) OnArrayData(bytes []byte) error {
this.currentArray = append(this.currentArray, bytes...)
return nil
}
func (this *testCallbacks) OnArrayEnd() error {
array := this.currentArray
this.currentArray = nil
switch this.currentArrayType {
case ArrayTypeBinary:
this.Value = array
case ArrayTypeString:
this.Value = string(array)
default:
return fmt.Errorf("Unhandled array type: %v", this.currentArrayType)
}
return nil
}
func decodeDocument(encoded []byte) (result interface{}, err error) {
callbacks := new(testCallbacks)
err = Parse(encoded, callbacks)
if err != nil {
return nil, err
}
result = callbacks.Value
return result, err
}
func TestUnquotedString(t *testing.T) {
expected := "abcd"
actual, err := decodeDocument([]byte(expected))
if err != nil {
t.Errorf("Parse error: %v", err)
}
if actual != expected {
t.Errorf("Expected [%v] but got [%v]", expected, actual)
}
}
Build command (ragel 6.10, go 1.13.3):
go mod init ragelbug
ragel -Z decoder.rl && go test
Result:
--- FAIL: TestUnquotedString (0.00s)
panic: runtime error: index out of range [5] with length 4 [recovered]
panic: runtime error: index out of range [5] with length 4
goroutine 19 [running]:
testing.tRunner.func1(0xc0000b2100)
/usr/local/go/src/testing/testing.go:874 +0x3a3
panic(0x5333e0, 0xc0000b6000)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
ragel-bug.Parse(0xc00008c078, 0x4, 0x8, 0x56dce0, 0xc00007c2a0, 0x8, 0x4)
decoder.go:129 +0x7d4
ragel-bug.decodeDocument(0xc00008c078, 0x4, 0x8, 0xc00008c078, 0x4, 0x8, 0xc1203b284f84)
/home/karl/Projects/ragel-bug/parser_test.go:41 +0x6e
ragel-bug.TestUnquotedString(0xc0000b2100)
/home/karl/Projects/ragel-bug/parser_test.go:51 +0x65
testing.tRunner(0xc0000b2100, 0x54f898)
/usr/local/go/src/testing/testing.go:909 +0xc9
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:960 +0x350
exit status 2
FAIL ragel-bug 0.005s
The failing line (decoder.go line 129, p = 5, data length = 4):
case data[p] < _ragelbug_trans_keys[_mid]:
$ cat test.rl %%{ machine test; action action1 {} action action2 {} nl = ("\r\n" | [\n\r]); kw = "aaaaa"; ident = "bbbbb" @action1; normal = (kw | ident); first = ([^\n\r] @action1)* . nl; cont = ( (" " @action1 when action1)* . (((([^\n\r] @action1)*) . nl @action1) when action1) ); special = first (cont when action2)** ; main := (normal when action1) | (special when action1); }%% $ ragel test.rl Segmentation fault $ ragel -V test.rl Segmentation fault $ ragel -T0 test.rl Segmentation fault $ ragel -T1 test.rl Segmentation fault $ ragel -F0 test.rl Segmentation fault $ ragel -F1 test.rl Segmentation fault $ ragel -d test.rl Segmentation fault $ ragel -e test.rl Segmentation fault $ ragel -n test.rl # succeeds $ ragel -m test.rl # succeeds $
Also the tarball provided in the website is missing the test directory.
Graphviz code generation was implemented off of the reduced machine because of the split between frontend and backend. Now that split is gone, and graphviz code generation forces us to consider making machines that are not complete, which complicates the reduced machine. We should just generate graphviz based off the FSM graph. Doing this naively will mean that the default transition will go away. This may turn out to be better ... not sure yet.
Results in code that does not compile. Should produce an error? Or maybe just change CS when in the leaving action?
From: Drake Wilson To: Debian Bug Tracking System Subject: ragel: emitted C code with -G2 in the presence of fgoto fails to compile Date: Fri, 27 Nov 2009 02:09:04 -0600 Package: ragel Version: 6.5-1 Severity: normal Here's a semi-minimal test machine: /* ---------------------------------------- */ %%{ machine foobar; alphtype unsigned char; bar := 'b' @{fbreak;} ; foo := 'a' %{fgoto bar;} ; }%% %%write data; void run(unsigned char const *p, unsigned char const *pe) { unsigned char const *const eof = pe; int cs; %%write init; %%write exec; } /* ---------------------------------------- */ $ ragel -C -G2 test.rl && gcc -c test.c test.rl: In function ‘run’: test.rl:6: error: label ‘st2’ used but not defined This appears to be because the fgoto for some reason doesn't cause a label to be generated for the target state, even though one is needed. ---> Drake Wilson
Currently duplicating a lot of code and data for the execution of EOF actions and conditions. Goal is to unify this with regular transitions.
Currently we first test if we have p == pe, then check if p == eof. But to make this change we want to first check if p == eof and to treat this like a transition. Otherwise we will need the p == pe test twice.
Doing this could break some poorly coded machines. Better to move to 8.0.
This ragel statement should put the machine into the error state and then break out. It has been started, but needs to be finished.
The usual string parsing causes backslash to escape, rather than path-separate.
When writing rules for a W3C standard like SPARQL using the notation specified in the XML standard it would be quite convenient if there was some support of converting unicode code points to machines matching utf-8 encoded code point.
E.g. (from the SPARQL specification):
#x00c0
converts to the state machine 0xc3 0x80
[#0x00c0-0x00d0]
converts to the state machine 0xc3 0x80..0x96
[#x037F-#x1FFF]
converts to 0xCD 0xBF | 0xCE..0xDF 0x80..0xBF | 0xE0..0xE1 0x80..0xBF 0x80..0xBF
(I have not yet verified the examples above, but I hope the idea is clear)
The syntax \u could be used as an alternative to the syntax #x for code points.
Leaving actions are not always appropriately executed when looping a scanner.
comment: Possibly want to take an optimization approach. For example, compile the machine with the scanner actions placed at a later time (and maybe link them to the possible optimzations. After compilation scan the state machine to see if we can push them back to get back to the optimized scanner solution we had previously.
comment: * If there are no leaving actions, leaving conditions, or leaving priorities, use the current implementation
The fact that both these approaches have problems leads to suggest to make scanners work properly in conjunction with leaving conditions and actions we need to utilized an NFA approach.
Taking the NFA approach means we need a recipe for preserving NFA state (pointers) across buffer blocks.
http://www.colm.net/pipermail/ragel-users/2018-December/003583.html
comment: Not able to reproduce, asked for more info on the list.
From Miek Gieben:
With new Go versions Ragel breaks, as the
newest weekly release(s) restricts the use of 'goto'.
See this message from Andrew Gerrand:
http://groups.google.com/group/golang-nuts/browse_thread/thread/a27ca841a496956b/6768a0f0326a6569?lnk=gst&q=goto#6768a0f0326a6569
This will soon show up in a 'stable' release thereby breaking
Ragel's ability to generate Go code.
reported by Dave McCaldon
ip_addr_parser.c(442) : warning C4244: '+=' : conversion from '__int64' to 'unsigned int', possible loss of data _trans += (_mid - _keys); ip_addr_parser.c(465) : warning C4244: '+=' : conversion from '__int64' to 'unsigned int', possible loss of data _trans += ((_mid - _keys)>>1);
ERROR: LoadError: MethodError: no method matching Array{Int64,1}(::Int64) Closest candidates are: Array{Int64,1}() where T at boot.jl:413 Array{Int64,1}(!Matched::UndefInitializer, !Matched::Int64) where T at boot.jl:394 Array{Int64,1}(!Matched::UndefInitializer, !Matched::Int64...) where {T, N} at boot.jl:400 ... Stacktrace: [1] m(::String) at /home/thurston/devel/colm-suite/test/ragel.d/working/any1_julia_e.jl:19 [2] top-level scope at none:0 [3] include at ./boot.jl:317 [inlined] [4] include_relative(::Module, ::String) at ./loading.jl:1044 [5] include(::Module, ::String) at ./sysimg.jl:29 [6] exec_options(::Base.JLOptions) at ./client.jl:266 [7] _start() at ./client.jl:425 in expression starting at /home/thurston/devel/colm-suite/test/ragel.d/working/any1_julia_e.jl:107
As it stands, conditions are implemented by expanding to values in the alphabet. This causes the alphabet to grow and makes it impossible to use conditions with long-sized alphabets (no space left). It is also a confusing implementation.
We should instead be representing transition on character as a the usual list, instead of a single transtion in the TransAp struct we should have a list of transitions for each active condition expression. Most of this time will be on the no-condition set.
Currently using same for both, so some code is needlessly duplicated.
This would permit us to use functions that should be called only once to retrieve a character.
via_parm = ( sent_protocol LWS sent_by ( SEMI ( via_branch | header_param ) )* ) >start_value %store_value; Via = ( "Via"i | "v"i ) >write_value >start_field %write_field HCOLON via_parm ( COMMA %write_value via_parm )*; So I would like to use smething like a C #define. This is, adding at the top of my Ragel file: #define COMMA_SEPARATED_VALUES(VALUE) ">write_value >start_field %write_field HCOLON VALUE ( COMMA %write_value VALUE )*;"
And then in the machine write:
Via = ( "Via"i | "v"i ) COMMA_SEPARATED_VALUE(via_parm)
Iñaki Baz Castillo [email protected]
[email protected]
I download http://www.colm.net/files/ragel/ragel-7.0.0.12.tar.gz, and build it fail on msys .
MSYS /d/tools/Ragel-6.6/ragel-7.0.0.12
$ ./configure
configure: loading site script /etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ar... ar
checking for ranlib... ranlib
checking build system type... x86_64-pc-msys
checking host system type... x86_64-pc-msys
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/x86_64-pc-msys/bin/ld.exe
checking if the linker (/usr/x86_64-pc-msys/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 24000
checking how to convert x86_64-pc-msys file names to x86_64-pc-msys format... func_convert_file_noop
checking how to convert x86_64-pc-msys file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-pc-msys/bin/ld.exe option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... unknown
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... (cached) ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... ./configure: line 7161: cmp: command not found
./configure: line 7161: cmp: command not found
checking how to truncate binary pipes... /usr/bin/sed -e 4q
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... ./configure: line 9101: diff: command not found
no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-pc-msys/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/x86_64-pc-msys/bin/ld.exe
checking if the linker (/usr/x86_64-pc-msys/bin/ld.exe) is GNU ld... yes
checking whether the g++ linker (/usr/x86_64-pc-msys/bin/ld.exe) supports shared libraries... no
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/x86_64-pc-msys/bin/ld.exe) supports shared libraries... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether make sets $(MAKE)... (cached) yes
checking size of int... 4
checking size of long... 8
checking for ragel... no
checking for kelbt... no
checking for colm... no
configure: error: colm is required to build ragel
In ragel 6 an fbreak in EOF actions will set CS = 0 in G2 code. Caused by the csForced parameter and passing the error state as the next state. This is clearly wrong.
In non-G2 code you get the correct results, which is to leave CS alone.
Not sure the state of this in ragel 7.
https://www.colm.net/pipermail/ragel-users/2019-November/003647.html
I often get this issue:
$ ragel-rust -o scanner.rs scanner_rl.rs
ragel: rlhc stopped by signal: 11
It's difficult to debug. I have had it go away if instead of including a machine from another file I just copy+paste it. Sill diagnosing this.
Edit: If I delete the .ri
file I get a (legitimate) parser error and a .ri
that doesn't reproduce the original signal 11 error! I have no idea what's going on, but somehow I get the .rl
/.ri
file combination into a particular bad state, and deleting the .ri
resets the state to something that does not necessarily reproduce the bad state...?!? Consequently, I can't consistently reproduce this error. Let me work on it some more until I can.
ubuntu 18.04 is up to gdc-8
If we can, take the highest gdc on the system
Recorded in email 2010-02-18 (ragel-bug)
Need to run a check in configure similar to julia to find out if we can run java in the current environment.
From Pablo Bleyer:
Is it currently possible to parametrize repetition numbers with
declarations or imported definitions? For example, "bytes{min,max}"
where 'min' and 'max' are defined in an import or constant expression?
2015-01-04
Input file: https://github.com/harfbuzz/harfbuzz/blob/master/src/hb-ot-shape-complex-use-machine.rl
alphtype
set to u8
ragel 5f9ebc9
> ./ragel-rust hb-ot-shape-complex-use-machine.rl
failed to parse output: <text2>:21:39: parse error
Can be reproduced with the following code:
%%{ machine safe16; access this.; main := "" %{fbreak;}; }%%
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.