]> ocean-lang.org Git - ocean/log
ocean
10 years agoparsergen - adjust for recent scanner fix.
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>
10 years agoscanner: don't allow an unknown mark to run into a string or comment
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>
10 years agoscanner: initialise token state properly.
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>
10 years agoscanner: fix do_strip bug.
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>
10 years agoMakefile: if bootstrap was required, suggest "make" be run again
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>
10 years agoUpdate .gitignore with new build targets
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>
10 years agoNew file: parsergen
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>
10 years agoscanner: must call close_token before returning the token.
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>
10 years agoscanner/numbers: fix typo that broken positive exponents.
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>
10 years agoscanner: make the array of known words "const"
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>
10 years agomdcode: rename code_print to code_node_print and export it.
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>
10 years agoFix typo in mdcode.mdc
NeilBrown [Fri, 12 Jul 2013 21:12:21 +0000 (07:12 +1000)]
Fix typo in mdcode.mdc

Signed-off-by: NeilBrown <neilb@suse.de>
10 years agoscanner.mdc: lexical scanner for Ocean.
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>
10 years agoMakefile: auto-support .mdc files.
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>
10 years agoRecord in a code_node whether it was indented or not.
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>
10 years agomdcode, md2c - extract C code from a literate markdown program
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>