summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* include an extern C function in libfsm so we can use AC_CHECK_LIBHEADmasterAdrian Thurston2023-03-121-0/+2
|
* generate a check for EOF if there are from-state actionsAdrian Thurston2021-12-286-7/+7
| | | | | | | | | From-state actions now execute on EOF, but we don't check for their presence when deciding if we should test against EOF. This led to from-state actions executing only if other conditions necessitating EOF-testing are present. Added the check. refs adrian-thurston/ragel#80
* Use /proc/self/exe to detect colm build directoryVictor Westerhuis2021-12-112-7/+16
| | | | | | | | | | | The canonical identity of a file on Unix is the combination of device and inode numbers. This code checks both possible paths for the colm executable: directly in the build directory (when colm is linked against libcolm statically) or in libtool's `objdir` subdirectory (when colm is linked against libcolm dynamically). This fails in two situations I can see: when /proc is not mounted or doesn't exist, or when colm is installed using a hard link.
* if buildDir is not set with -B, try to find a defaultAdrian Thurston2021-12-112-1/+21
| | | | | | | | | | | | | | | When running from the build directory, if one forgets to give -B, and colm was previously installed at the current prefix, colm programs will build against the installed version, not the local source tree. This won't be immediately obvious and could lead to confusion during development. To prevent this, try to find the buildDir if one is not given. The tests can continue to specify the buildDir with -B, which is the most safe way. The buildDir is defaulted by testing the buildDir known at compile time against LD_LIBRARY_PATH. Libtool on ubuntu 20.04 will place the buildDir at the head of LD_LIBRARY_PATH. It seems likely that it would do this on all systems, making it a seemingly good test.
* Fix some spelling errorsVictor Westerhuis2021-12-063-3/+3
|
* added ignore for src/stamp-h3Adrian Thurston2021-12-041-0/+1
|
* Merge pull request #138 from viccie30/fix-out-of-tree-buildAdrian Thurston2021-12-046-134/+49
|\ | | | | Some build system fixes
| * Honor includedir and libdir settingsVictor Westerhuis2021-12-042-4/+5
| | | | | | | | | | They are usually direct subdirectories of the prefix, but they can be different, for example in Debian's multiarch scheme.
| * Honor CC and CFLAGS environment variablesVictor Westerhuis2021-12-041-4/+15
| | | | | | | | This makes it easier to use a cross-compiler, for example.
| * Clean up moreVictor Westerhuis2021-12-041-0/+1
| | | | | | | | | | Everything built by make should be cleaned up by make clean, according to the automake manual.
| * Make colm executable buildable in out-of-tree buildVictor Westerhuis2021-12-041-4/+4
| |
| * Move src/include/colm generation to config.statusVictor Westerhuis2021-12-041-1/+3
| | | | | | | | | | | | | | The list of linked headers comes from RUNTIME_HDR in src/Makefile.am. Also don't delete it in clean, but do delete it in distclean, like any file configured by config.status.
| * Remove empty header src/rtvector.hVictor Westerhuis2021-12-044-38/+2
| | | | | | | | | | This header has been empty since 2010. It is not installed, so it does not change the installation.
| * Move version.h generation to config.statusVictor Westerhuis2021-12-042-1/+2
| | | | | | | | | | | | | | | | This means that automake makes sure it's remade when configure{,.ac} or version.h.in change. Also don't delete it in clean, but do delete it in distclean, like any file configured by config.status.
| * Delete automatic detection of running in-sourceVictor Westerhuis2021-12-041-83/+18
| | | | | | | | | | | | | | | | This cannot work reliably when using a separate build dir. Instead, add a new switch to specify the build directory explicitly. Use libtool to build the output, defaulting to statically linking libcolm.
* | cgil: permit ''' in rust output languageAdrian Thurston2021-12-031-1/+1
|/ | | | Helps with adrian-thurston/ragel#3.
* Fix out-of-bounds memcpyVictor Westerhuis2021-12-031-1/+2
| | | | | memcpy in string_alloc_full was copying 32 bytes, while the string is only 25 bytes including the terminating null byte.
* fix: check enable_static and enable_shared and link libcolm appropriatelyAdrian Thurston2021-11-271-0/+7
| | | | | | If --disable-static or --disable-shared is used, then pass this info to compilation of main.cc and link with libcolm appropriately. Default to a static as has been done for some time. refs adrian-thurston/ragel#70.
* install data files to PREFIX/share/colm (pkgdata_DATA)Adrian Thurston2021-11-231-1/+1
| | | | | Was using data_DATA, which lands in PREFIX/share. This is a nuisance for packaging. refs #134
* can remove the now empty allocgen.ccAdrian Thurston2021-11-071-1/+1
|
* remaining parts of common.cc moved over to ragelAdrian Thurston2021-11-074-338/+16
| | | | This includes output filter, file name functions, and line directive generation
* moved HostLang type and makeCodeGen funcs to ragelAdrian Thurston2021-11-077-137/+22
|
* moved the findAlphType code over to ragelAdrian Thurston2021-11-074-54/+0
|
* moved the C and ASM host types over to ragelAdrian Thurston2021-11-072-81/+0
|
* moved writeStatement into InputData in ragelAdrian Thurston2021-11-072-92/+0
| | | | | | Write statement belongs in ragel, but can't yet move out CodeGenData. It's at the base of many codegen classes that will live in colm. The functionality here needs to be lifted up out of the base.
* C codegen: use the 'signed' prefix when specifying the size of the signed typesAdrian Thurston2021-11-061-4/+4
|
* C codegen: use SCHAR_MIN and SCHAR_MAX for signed char host typeAdrian Thurston2021-11-061-1/+1
|
* C codegen: decide char signedness based on value of CHAR_MINAdrian Thurston2021-11-061-12/+12
| | | | | | | | | Decide signedness of "char" on at runtime (probably compile time) using a check on CHAR_MIN. This should work with cross compiling setups. With this approach, if you plan to use "char" on ARM you cannot literally specify outside the range 0-127 using decimal/hex. If you need that you can use "signed char" or "unsigned char".
* allow the base expression in deref and offset to be an expressionAdrian Thurston2021-09-2114-50/+63
| | | | | | Previously allowed only identifier as the base. This is necessary to use the generated DATA() as the base in these expressions, which can be modified by access and therefore must be an expression.
* moved creation of version.h and src/include/colm to configureAdrian Thurston2021-02-071-70/+6
|
* build fixes: gen/if[123].cc must depend on gen/if[123].hAdrian Thurston2021-02-061-3/+3
|
* remove all dependence on BUILT_SOURCESAdrian Thurston2021-01-312-30/+97
| | | | | Still running into issues on gentoo with BUILT_SOURCES. Instead make all the necessary dependencies explicit, using the source code files.
* fix vm_pop_type for big-endian systemsAdrian Thurston2021-01-181-1/+1
| | | | | | | | | | | | Change the pop to cast the pointer and take the value using a pointer to the requested type, then return that tmp. Previously we were taking the value using the tree type, then casting the value. During the cast of the value the high bits are dropped, and that's where the value actually lives, when on a big-endian system. Didn't notice the problem on little-endian systems because it happens to work fine there. Fixes #126.
* various refcount fixesAdrian Thurston2021-01-035-54/+48
| | | | | | - added downref when undoing a tree push - using correct opcode for undoing pushing stream - added an upref when sending back ignored trees
* removed duplicate version COLM_VERSIONAdrian Thurston2020-12-232-5/+5
| | | | | This was left over from the time colm and ragel were in one repos. Now just use VERSION and PUBDATE.
* include version in libfsm library install pathAdrian Thurston2020-12-231-1/+1
|
* added with_ignore(tree) iteratorAdrian Thurston2020-12-238-12/+73
| | | | | | | | | | | | This is identical to the basic tree iterator, except it visits ignore tokens. This makes it possible to rewrite comments, albeit, primitively. Constructors for tokens don't work right. Though we can set the data field. The following code can be used to turn comments into newlines: for I1: comment in with_ignore(Flux) { I1.data = "\n" }
* don't use InputLoc in GenAction so we can keep it trivial.Adrian Thurston2020-12-093-4/+5
|
* casting template type pointers to void* before passing to memmove funcsAdrian Thurston2020-12-096-28/+31
| | | | | | | More recent compilers will now warn about moving and copying non-trivial types, due to the potential for internal pointers. This is a risk the libraries always had, and it is expected to not put those things into the containers. Casting to void* removes the new warnings and better expresses what the code is doing.
* added config.h.in~ to git ignore listAdrian Thurston2020-12-091-0/+1
|
* need to re-issue va_start before the second vsnprintfAdrian Thurston2020-12-091-0/+1
|
* use fopencookie to avoid leaking FILE structsAdrian Thurston2020-12-082-8/+76
| | | | | | | If we use fdopen for stdin/out/err we cannot close it to free the file struct without also closing the file descriptor. If fopencookie is available, use that to wrap the file descriptor, but allow closing without closing the fd. This is useful when embedding in long running programs.
* dump_contents is only used when DEBUG is enabledAdrian Thurston2020-12-071-0/+2
| | | | Wrap dump_contents in #ifdef DEBUG.
* don't leak the stream_impl::line_len arrayAdrian Thurston2020-12-071-0/+4
|
* lift all source code into src/ dirinto-srcAdrian Thurston2020-10-18135-1/+47688
|
* replced bare send syntax whith << and <- formsAdrian Thurston2020-07-182-4/+9
| | | | | | Elimintates associated ambiguity between extending statements and starting a new one. Bare send was a nice idea, but it is too much for the language to bear.
* allow colm-command (-w) to be a full pathAdrian Thurston2020-04-141-3/+7
| | | | Don't try and compute the path to the command when it is already specified.
* correct prodNum as we combine productions to implement [...]Adrian Thurston2020-04-143-6/+12
| | | | refs #112
* renamed DefList and LelDefList to the more accurate ProdList, LelProdListAdrian Thurston2020-04-1215-112/+112
|
* first cut of a redefine statementAdrian Thurston2020-04-126-49/+136
| | | | | | | | Redefine happens during declaration. The existing langEl is removed from the map and a newly-declared lel replaces it. If the new list of productions references [...] the productions from the previous lel are moved into the new one, in its place. A copy would be preferrable, as move may require some fixup, but move gives an initial functional implementation. refs #112