]>
ocean-lang.org Git - ocean/log
summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
NeilBrown [Sun, 24 Nov 2013 05:53:34 +0000 (16:53 +1100)]
parsergen: various cosmetic fixes
- various typos
- remove double spaces
- re-arrange some text slightly.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Thu, 25 Jul 2013 10:23:26 +0000 (20:23 +1000)]
parsergen: report some tokens better when tracing.
Some tokens are best traced by giving their name rather
than their content. e.g. newline. So make a special
case of those.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Thu, 25 Jul 2013 10:15:43 +0000 (20:15 +1000)]
Refresh boot-strap files.
There have been some changes to mdcode.mdc, so time to
update the generated files in 'boot-strap'
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Thu, 25 Jul 2013 10:13:22 +0000 (20:13 +1000)]
Rename Indent and Undent to IN and OUT
These names work better for me.
There is an indent on every line, so the place where the
indent increases shouldn't be called "indent".
And "undent" isn't a word.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 10:44:07 +0000 (20:44 +1000)]
parsergen: remove 'depth' arg from do_reduce.
This was only used for tracing and now tracing is done differently.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 09:27:27 +0000 (19:27 +1000)]
parsergen: allow "$void" to remove current type.
This allows return to the initial state where nonterminals
have no type.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 09:18:09 +0000 (19:18 +1000)]
parsergen: improve tracing.
Change the tracing to print the full stack after every step.
This can be cross-referenced with the report that parsergen
can generate to get a full picture of how the parse is progressing.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 08:20:00 +0000 (18:20 +1000)]
parsergen: make sure we continue making states until all done.
Whenever we add a state, we need to check again, as it might have been
added early in the list.
There is probably a much more efficient way to do this....
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 08:10:45 +0000 (18:10 +1000)]
parsergen: change sort order for items.
I want items with larger indexes to always preceed smaller
indexes. This makes the report easier to follow.
So negate the index number (and add an offset) when sorting.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 08:04:24 +0000 (18:04 +1000)]
parsergen: change symset function to use 'unsigned short'.
To make full use of all 16 bits of a sym, we should make sure
we consistent use "unsigned".
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 08:00:13 +0000 (18:00 +1000)]
parsergen: fix bug testing return value for shift()
shift() returns 0 on failure, not negative.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 07:58:34 +0000 (17:58 +1000)]
parsergen - adjust for recent scanner fix.
scanner was recently fixed to correctly skip over C code with
a string immediately after a '(', so we can remove the extra
spaces we inserted before.
For this to work, we need to stop ignoring TK_String
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 07:53:51 +0000 (17:53 +1000)]
scanner: don't allow an unknown mark to run into a string or comment
This means that e.g.
printf("hello")
where no marks are declared will not treat
("
as an known mark, but instead find
(
and then a string.
This is important for skipping over C code in 'parsergen'.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 07:52:39 +0000 (17:52 +1000)]
scanner: initialise token state properly.
We need to call do_strip() at the start to ensure the correct
col and indent is used for the first token.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sun, 21 Jul 2013 07:51:37 +0000 (17:51 +1000)]
scanner: fix do_strip bug.
do_strip wasn't striping tabs properly
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Fri, 12 Jul 2013 21:25:00 +0000 (07:25 +1000)]
Makefile: if bootstrap was required, suggest "make" be run again
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Fri, 12 Jul 2013 21:23:03 +0000 (07:23 +1000)]
Update .gitignore with new build targets
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Fri, 12 Jul 2013 21:21:37 +0000 (07:21 +1000)]
New file: parsergen
This reads and analyses a grammar and generates a parser.
It include a simple calculator
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Fri, 12 Jul 2013 21:18:06 +0000 (07:18 +1000)]
scanner: must call close_token before returning the token.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Fri, 12 Jul 2013 21:16:07 +0000 (07:16 +1000)]
scanner/numbers: fix typo that broken positive exponents.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Fri, 12 Jul 2013 21:15:32 +0000 (07:15 +1000)]
scanner: make the array of known words "const"
After all, it shouldn't change.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Fri, 12 Jul 2013 21:13:55 +0000 (07:13 +1000)]
mdcode: rename code_print to code_node_print and export it.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Fri, 12 Jul 2013 21:12:21 +0000 (07:12 +1000)]
Fix typo in mdcode.mdc
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sat, 22 Jun 2013 09:18:55 +0000 (19:18 +1000)]
scanner.mdc: lexical scanner for Ocean.
This scanner does lexical analysis and produces tokens.
It also handles numbers and escapes in strings.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sat, 22 Jun 2013 09:17:49 +0000 (19:17 +1000)]
Makefile: auto-support .mdc files.
Any *.mdc cause "md2c" to be run to create a "*.mk" file which is
included and used.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Sat, 22 Jun 2013 07:39:23 +0000 (17:39 +1000)]
Record in a code_node whether it was indented or not.
This is needed to correctly adjust for this indent when processing the
code.
Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown [Wed, 5 Jun 2013 20:20:35 +0000 (06:20 +1000)]
mdcode, md2c - extract C code from a literate markdown program
All C programs here will be written in literate style using markdown.
md2c strips out the C code so that it can be compiled.
Signed-off-by: NeilBrown <neilb@suse.de>