Commit graph

18 commits

Author SHA1 Message Date
1f122fae82 Rename the MODDIR makefile variable to JWBDIR
Rename the omnipresent MODDIR variable to JWBDIR, since that's more to the
point.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-06-29 23:32:20 +02:00
6dd594d47b Fix multiple Python 3 compatibility issues
Changes in Python 3 that made the code choke:

  o basestring is merged into str
  o print() needs parentesis
  o Class inheritance syntax changed
  o Abstract baseclass (ABCMeta) syntax changed
  o map.iteritems() is replaced by map.items()
  o Inconsistent use of tabs and spaces are no longer tolerated

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-10 16:38:59 +01:00
fc5241a2e8 Now excplicitly calling python2 executable instead of python
Signed-off-by: Jan Lindemann <jan@janware.com>
2018-01-02 13:09:06 +00:00
150bf5fd69 test/trim-src: Fix: test.mk doesn't belong into the git repo
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-11-25 16:15:55 +01:00
74a27f1c19 Add conf/profile
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-11-18 15:43:49 +01:00
24ba182fa1 Add script trim-src.py
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-11-18 15:42:09 +01:00
c2c409ed4b Move grammar-related stuff into package jw-grammar
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-11-12 16:08:26 +01:00
3cba245b77 grammar.py and friends: Improve line numbers and headers
Line numbers of parsed input are now automatically maintained. More
needed data structures are now automatically created in the API header
file.

Signed-off-by: Jan Lindemann <jan@janware.com>
2017-11-03 12:54:19 +01:00
a3a8313ce8 grammar.py and friends: Make list parsing run through
First time parsing doesn't error out with a syntax error. No usable AST
is produced, strings are not returned from lexer, and AST lists aren't
lists, really.

TEXT:="Hello world!"; had to be excluded from the example, because I
don't get how this could be parsed with the given syntax. There's a
special sequence "all visible characters", but any lexer regex I could
think of will also match the types defining "alphabetic character" and
return the respective tokens (e.g. T_A) or vice-versa, depending on the
order in the lexer input file. I suppose, the only sensible way to
handle this, is to define "all visible characters" by defining the
tokens for the missing characters, and then use them along T_A ... T_Z
or their derived types.

Signed-off-by: Jan Lindemann <jan@janware.com>
2017-11-02 13:47:19 +01:00
1a7a34f73c grammar.py and friends: Implement config file support
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-11-02 08:54:39 +01:00
16ce7abd93 grammar.py and friends: Make test/grammar compile and start
Doesn't successfully parse grammartest.code, yet, it errors out with a
syntax error on whitespace. But at least it compiles and starts.

Signed-off-by: Jan Lindemann <jan@janware.com>
2017-10-30 13:05:22 +01:00
6297f10f55 grammar.py et al: Centralize more code
More code is removed from the special parser directories and centralized
into grammar.py, Cmd.py, and generate-flex-bison.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2017-10-29 18:25:55 +01:00
4fee6ac06e grammar.py: Add support for --replace-whitespace
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-10-29 13:56:52 +01:00
cbdd343f85 grammar.py: Add grammar_unroll_alternatives()
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-10-29 13:13:14 +01:00
432d78cdc5 grammar.py: Add grammar_parse_ebnf_tokens()
Add grammar_parse_ebnf_tokens(), to be used by external grammar parsers
and grammar_parse_ebnf()

Signed-off-by: Jan Lindemann <jan@janware.com>
2017-10-28 19:16:00 +02:00
40e6add5ad Continue implementation of grammar.py
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-10-25 13:45:44 +02:00
4c076691a6 Rename module jwutil to jwutils
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-07-24 13:00:37 +02:00
5755d14d84 initial checkin
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-07-24 12:19:34 +02:00