From: <jfa...@us...> - 2009-07-13 01:47:31
|
Revision: 4912 http://oorexx.svn.sourceforge.net/oorexx/?rev=4912&view=rev Author: jfaucher Date: 2009-07-13 01:47:23 +0000 (Mon, 13 Jul 2009) Log Message: ----------- Work in progress, 1st step reached. The XML parser is operational on the oorexx doc files. I can read a SGML file and print it on stdout unchanged (same layout). Tested on fundclasses.sgml Next step : implement the option -fix which will let generate a valid XML. Modified Paths: -------------- incubator/DocMusings/makevalidxml/_diary.txt incubator/DocMusings/makevalidxml/makevalidxml.rex incubator/DocMusings/makevalidxml/myxmlparser.cls incubator/DocMusings/railroad/_diary.txt incubator/DocMusings/railroad/generate.rex incubator/DocMusings/railroad/syntaxdiagram2svg/css/syntaxdiagram.css incubator/DocMusings/railroad/syntaxdiagram2svg_out/DO-conditional.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/DO-repetitor.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/DO.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/Decimal integer.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/Hexadecimal literal.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/IPV4 address in dot form-IPv4-range integer.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/IPV4 address in dot form-decimal digit.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/IPV4 address in dot form.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/MathLoadFuncs.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/RxCalcSqrt.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/URL syntax 1.png incubator/DocMusings/railroad/syntaxdiagram2svg_out/URL syntax 2.png Modified: incubator/DocMusings/makevalidxml/_diary.txt =================================================================== --- incubator/DocMusings/makevalidxml/_diary.txt 2009-07-13 00:37:08 UTC (rev 4911) +++ incubator/DocMusings/makevalidxml/_diary.txt 2009-07-13 01:47:23 UTC (rev 4912) @@ -1,4 +1,36 @@ =============================================================================== +2009 july 12 + +The first step has been reached... +The command makevalidxml can read a SGML file and print it to stdout unchanged (same layout). +But behind the scene, I have all the informations needed to transform the XML where needed. +The following options remain to implement : +-fix +-xinclude + + +=============================================================================== +2009 july 11 + +I need effectively to modify the XML parser, to keep the text as-is : +- getchar returns EOL as any other char. +- Each chunk has a value in its text property, to be used for printing as-is. + + +Things to fix to have a valid XML : + +<?xml version="1.0" standalone="no"> +must be +<?xml version="1.0" standalone="no"?> + +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" +must have a system identifier +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" + +<imagedata> must be completed by </imagedata> + + +=============================================================================== 2009 june 27 First step : Modified: incubator/DocMusings/makevalidxml/makevalidxml.rex =================================================================== --- incubator/DocMusings/makevalidxml/makevalidxml.rex 2009-07-13 00:37:08 UTC (rev 4911) +++ incubator/DocMusings/makevalidxml/makevalidxml.rex 2009-07-13 01:47:23 UTC (rev 4912) @@ -39,53 +39,277 @@ /* */ /*----------------------------------------------------------------------------*/ +/**** +Usage : + makevalidxml [-debug] [-dump] [-fix] [-help] [-xinclude] <filename> +Description : + This script is intended to work on the XML files of the ooRexx doc. + It reads the file <filename>, parses it and sends it to stdout. + By default, the layout of the output file is kept the most similar possible + to the layout of the input. + Options : + -debug : Insert additional informations in the ouptut. + -dump : The elements and attributes are dumped without attempting to + keep the original layout. + -fix : The output is modified where needed, to make it valid XML. + -xinclude : Use <xi:include> instead of XML entities to include files. +****/ --- JLF : Nothing started, yet... -use strict arg filename +parse source . callType . +arguments = .Arguments~new(callType, arg(1,"array")) +if arguments~error <> "" then do + call Help arguments~error + return 1 +end + +if arguments~helpOption then do + call Help + return 0 +end + parser = .myparser~new() -errortxt = parser~parse_file(filename) +parser~debug = arguments~debugOption +parser~dump = arguments~dumpOption +errortxt = parser~parse_file(arguments~filename) +if errortxt <> "" then do + say errortxt + return 1 +end -return +return 0 ::requires 'myxmlparser.cls' ::class myparser subclass xmlparser +::attribute dump + ::method start_element -use arg chunk -call charout , '<'chunk~tag -if chunk~attr <> .nil then do f over chunk~attr - call charout , ' 'f'="'self~textxlate(chunk~attr[f])'"' - end -say '>' -return + use arg chunk + if self~dump then do + if self~debug then say '[start_element:'chunk~line':'chunk~col'[' + call charout , '<'chunk~tag + if chunk~attr <> .nil then + do f over chunk~attr + call charout , ' 'f'="'self~textxlate(chunk~attr[f])'"' + end + call charout , '>' -- say '>' + if self~debug then say ']start_element]' + end + else do + if self~debug then call charout , '[start_element:'chunk~line':'chunk~col'[' + call charout , '<'chunk~text'>' + if self~debug then call charout , ']start_element]' + end + return ::method end_element -use arg chunk -say '</'chunk~tag'>' -return + use arg chunk + if self~dump then do + if self~debug then say '[end_element'chunk~line':'chunk~col'[' + call charout , '</'chunk~tag'>' -- say '</'chunk~tag'>' + if self~debug then say ']end_element]' + end + else do + if self~debug then call charout , '[end_element:'chunk~line':'chunk~col'[' + if chunk~text = '' then call charout , '</'chunk~tag'>' + if self~debug then call charout , ']end_element]' + end + return ::method passthrough -use arg chunk -say '<'chunk~text'>' -return + use arg chunk + if self~dump then do + if self~debug then say '[passthrough:'chunk~line':'chunk~col'[' + call charout , '<'chunk~text'>' -- say '<'chunk~text'>' + if self~debug then say ']passthrough]' + end + else do + if self~debug then call charout , '[passthrough:'chunk~line':'chunk~col'[' + call charout , '<'chunk~text'>' + if self~debug then call charout , ']passthrough]' + end + return ::method text -use arg chunk -say chunk~text -return + use arg chunk + if self~dump then do + if self~debug then call charout , '[text:'chunk~line':'chunk~col'[' + call charout , chunk~text + if self~debug then say ']text]' + end + else do + if self~debug then call charout , '[text:'chunk~line':'chunk~col'[' + call charout , chunk~text + if self~debug then call charout , ']text]' + end + return ::method error -use arg err -say err~text -return + use arg err + say err~text + return -::method textxlate private -use arg text -text = text~changestr('&', '&') -- always do this one first! -text = text~changestr('>', '>') -text = text~changestr('<', '<') -return text +::method xlatetext private + use arg text + /* + text = text~changestr('&', '&') -- always do this one first! + text = text~changestr('>', '>') + text = text~changestr('<', '<') + */ + return text +------------------------------------------------------------------------------- +::class Arguments +::attribute debugOption +::attribute dumpOption +::attribute error +::attribute filename +::attribute fixOption +::attribute helpOption +::attribute xincludeOption + +::method init + self~debugOption = .false + self~dumpOption = .false + self~error = "" + self~filename = "" + self~fixOption = .false + self~helpOption = .false + self~xincludeOption = .false + + -- Tokenize the arguments, if needed + use strict arg callType, arguments -- always an array + select + when callType == "COMMAND" & arguments~items == 1 then args = String2Args(arguments[1]) + when callType == "SUBROUTINE" & arguments~items == 1 & arguments[1]~isA(.array) then args = arguments[1] + otherwise args = arguments + end + + -- Use makeArray to have a non-sparse array, + -- because omitted parameters have no corresponding index, + -- and we ignore omitted parameters here. + args = args~makeArray + + -- Process the options + loop i=1 to args~items + option = args[i] + if option~left(1) <> "-" then leave + select + when "-debug"~caseLessEquals(option) then self~debugOption = .true + when "-dump"~caseLessEquals(option) then self~dumpOption = .true + when "-fix"~caseLessEquals(option) then self~fixOption = .true + when "-help"~caseLessEquals(option) then self~helpOption = .true + when "-xinclude"~caseLessEquals(option) then self~xincludeOption = .true + otherwise do + self~error = "Unknown option" option + return + end + end + -- Return now if help requested + if self~helpOption then return + end + + -- Process the arguments + if i > args~items then do + self~error = "<filename> is missing" + return + end + self~filename = args[i]~strip + i += 1 + if i > args~items then return + self~error = "Unexpected arguments :" args~section(i)~toString("L", " ") + return + + +------------------------------------------------------------------------------- +::routine String2Args public + -- Converts a string to an array of arguments. + -- Arguments are separated by whitespaces (anything < 32) and can be quoted. + -- This routine tries to follow the behavior of cmd.exe, which lets write such things : + -- %1 %2 %3 + -- myscript c:\dir1\my dir\dir 2 c:\dir1\my dir\dir 2 + -- myscript "c:\dir1\my dir\dir 2" "c:\dir1\my dir\dir 2" + -- myscript c:\dir1\"my dir"\dir 2 c:\dir1\"my dir"\dir 2 + -- myscript c:\dir1\my dir\dir" 2" c:\dir1\my dir\dir" 2" + -- myscript he says "I told you "hello"!" he says "I told you "hello"!" + -- myscript he says "I told you ""hello""!" he says "I told you ""hello""!" + -- + -- Unlike cmd, this routine does an additional processing : + -- Quotes are removed from the value, except when they are doubled inside a quoted string. + -- cmd parameter value in args + -- c:\dir1\my 'c:\dir1\my' + -- "c:\dir1\my dir\dir 2" 'c:\dir1\my dir\dir 2' + -- c:\dir1\"my dir"\dir 'c:\dir1\my dir\dir' + -- "I told you "hello"!" 'I told you hello!' + -- "I told you ""hello""!" 'I told you "hello"!' + use strict arg string + + args = .Array~new + i = 1 + + loop label arguments + -- Skip whitespaces + loop + if i > string~length then return args + if string~subchar(i) > " " then leave + i += 1 + end + + -- Process current argument : can be made of several chunks, all chunks are concatenated + -- Example chunk1 chunk2 chunk3 value + -- one one 'one' + -- "one two" "one two" 'one two' + -- one" two "three one " two " three 'one two three' + -- one" ""two"" "three one " ""two"" " three 'one "two" three' + current = .MutableBuffer~new + loop label current_argument + if string~subchar(i) == '"' then do + -- Chunk surrounded by quotes : whitespaces are kept, double occurrence of quotes are replaced by a single embedded quote + loop label quoted_chunk + i += 1 + if i > string~length then return args~~append(current~string) + select + when string~subchar(i) == '"' & string~subchar(i+1) == '"' then do + current~append('"') + i += 1 + end + when string~subchar(i) == '"' then do + i += 1 + leave quoted_chunk + end + otherwise current~append(string~subchar(i)) + end + end quoted_chunk + end + if string~subchar(i) <= " " then do + args~append(current~string) + leave current_argument + end + -- Chunk not surrounded by quotes : ends when a whitespace or quote is reached + loop + if i > string~length then return args~~append(current~string) + if string~subchar(i) <= " " | string~subchar(i) == '"' then leave + current~append(string~subchar(i)) + i += 1 + end + end current_argument + end arguments + return args + +------------------------------------------------------------------------------- +::routine Help + use strict arg errorMessage="" + if errorMessage <> "" then say errorMessage + -- The help text is taken from the comment at the begining of the source file. + display = .false + do line = 1 to sourceline() + sourceline = sourceline(line) + if sourceline~pos("****/") <> 0 then leave + if display then say sourceline + if sourceline~pos("/****") <> 0 then display = .true + end + return + Modified: incubator/DocMusings/makevalidxml/myxmlparser.cls =================================================================== --- incubator/DocMusings/makevalidxml/myxmlparser.cls 2009-07-13 00:37:08 UTC (rev 4911) +++ incubator/DocMusings/makevalidxml/myxmlparser.cls 2009-07-13 01:47:23 UTC (rev 4912) @@ -84,8 +84,7 @@ JLF : adaptation of xmlparser.cls to my own needs. - reprint the parsed XML the most possible like the original one. - add missing closing tags -Don't know yet if can do that only by overriding the public methods, so I made -a copy of the XML parser. +I need to modify the parser, to keep the text unchanged, hence this copy... */ @@ -112,8 +111,14 @@ ::method charidx attribute private -- the index into a xml line ::method errortxt attribute private -- error text ::method eof attribute private -- done parsing? +::attribute endofline -- derived from the first line of the xml file, assume all lines have this EOL +::attribute lastlineendofline -- except the last line which may have no EOL +::attribute debug +::method init +self~debug = .false + /*----------------------------------------------------------------------------*/ /* Method: create_error */ /* Description: creates an xmlerror instance. */ @@ -143,15 +148,49 @@ /*----------------------------------------------------------------------------*/ +/* Method: detect_eol_style */ +/* Description: detect the EOL style of the first line and last line */ +/*----------------------------------------------------------------------------*/ +::method detect_eol_style +use strict arg stream +self~endofline = "" +previouschar = "" +stream~seek("=1") +do forever + currentchar = stream~charin + if currentchar == "" then leave -- EOF + if c2x(currentchar) == "0A" then do + if c2x(previouschar) == "0D" then self~endofline = x2c("0D0A") + else self~endofline = x2c("0A") + leave + end + previouschar = currentchar +end + +-- It's not possible to make a distinction between a last (non empty) line without EOL +-- and a last (non empty) line with EOL, when working with the array returned by stream~arrayIn. +-- Hence this attribute... +self~lastlineendofline = "" +stream~seek("<1") +lastchar = stream~charin +if c2x(lastchar) == "0A" then self~lastlineendofline = self~endofline +return + + +/*----------------------------------------------------------------------------*/ /* Method: current char */ -/* Description: return the current character. */ +/* Description: return the current character, or one of the relative */ +/* characters of the current line */ /*----------------------------------------------------------------------------*/ ::method currentchar private expose src lineidx charidx -use strict arg -if lineidx > src~items then return .nil -return src[lineidx]~substr(charidx, 1) +use strict arg offset=0 -- can be negative +if lineidx > src~items then return '' +charpos = charidx + offset +if charpos < 1 then return '' +if charpos > src[lineidx]~length then return '' +return src[lineidx]~substr(charpos, 1) /*----------------------------------------------------------------------------*/ @@ -162,16 +201,22 @@ ::method getchar private expose src lineidx charidx eof use strict arg -character = src[lineidx]~substr(charidx, 1) -charidx = charidx + 1 +if lineidx > src~items then do + eof = .true + return '' + end if charidx > src[lineidx]~length then do lineidx = lineidx + 1 charidx = 1 + if lineidx > src~items then do + if self~lastlineendofline <> "" then return self~lastlineendofline + eof = .true + return '' + end + return self~endofline end -if lineidx > src~items then do - eof = .true - return '' - end +character = src[lineidx]~substr(charidx, 1) +charidx = charidx + 1 return character @@ -186,33 +231,39 @@ errlineidx = lineidx errcharidx = charidx chunk = .xmlchunk~new +chunk~line = lineidx +chunk~col = charidx if self~currentchar() <> '<' then do - /* we found some CDATA */ - chunk~text = '' + /* we found some TEXT */ curline = lineidx + buffer1 = .MutableBuffer~new do while eof = .false & self~currentchar() <> '<' -- Do NOT collapse the white space and newlines out of the chunk! -- We leave that task up to the client of this class. - -- Instead, we return a chunk with .endofline stuck in between + -- Instead, we return a chunk with self~endofline stuck in between -- at the linebreaks. - chunk~text = chunk~text || self~getchar() + buffer1~append(self~getchar()) if curline <> lineidx then do - chunk~text = chunk~text || .endofline curline = lineidx end end - chunk~text = self~xlatetext(chunk~text) - if chunk~text~strip <> '' then , + chunk~text = self~xlatetext(buffer1)~string + -- if chunk~text~strip <> '' then , -- never strip a TEXT self~text(chunk) -- call the public override method return chunk end /* we found an XML tag, process it */ character = self~getchar() -- skip the '<' -element = '' curline = lineidx nestlevel = 0 +buffer2 = .MutableBuffer~new +do i=0 to 7 + buffer2~append(self~currentchar(i)) +end +iscdata = (buffer2~string == "![CDATA[") +buffer3 = .MutableBuffer~new do while eof = .false - if element~substr(1, 1) = '!' then do + if \iscdata & buffer3~substr(1, 1) = '!' then do -- It is possible for tags to be contained within other tags in XML -- processing tags. The next two IF statements take care of that nesting -- possibility. It will be up to the user to parse out the contained @@ -220,61 +271,87 @@ if self~currentchar() = '<' then nestlevel = nestlevel + 1 if self~currentchar() = '>' & level > 0 then nestlevel = nestlevel - 1 end - element = element || self~getchar() + buffer3~append(self~getchar()) if curline <> lineidx then do - element = element || ' ' curline = lineidx end - if self~currentchar() = '>' & nestlevel = 0 then leave + if self~currentchar() = '>' then do + if iscdata then do + if self~currentchar(-2) || self~currentchar(-1) == "]]" then leave + end + else if nestlevel = 0 then leave + end + if eof = .true then do + errortxt = 'Error line' errlineidx': EOF within an XML tag.' + self~error(self~create_error(errortxt, errlineidx, errcharidx)) -- call the public override method + return .nil + end end -if eof = .true then do - errortxt = 'Error line' errlineidx': EOF within an XML tag.' - self~error(self~create_error(errortxt, errlineidx, errcharidx)) -- call the public override method - return .nil - end -element = element~strip() +raw_element = buffer3~string +if \iscdata then buffer3~changeStr(self~endofline, " "~copies(self~endofline~length)) -- replace endofline by space(s) +element = buffer3~string~strip() +if self~debug then call lineout "stderr", errlineidx":"currentSourceLine()":element=["element"]" select when element~substr(1, 1) = '/' then do chunk~tag = element~substr(2) + chunk~text = '' -- empty ==> </tag> will be displayed self~end_element(chunk) -- call the public override method end when pos('?', element~substr(1, 1)) > 0 then do chunk~tag = '' - chunk~text = element + chunk~text = raw_element self~passthrough(chunk) -- call the public override method end when pos('!--', element~substr(1, 3)) > 0 then do chunk~tag = '' - chunk~text = element + chunk~text = raw_element self~passthrough(chunk) -- call the public override method end when pos('!', element~substr(1, 1)) > 0 then do chunk~tag = '' - chunk~text = element + chunk~text = raw_element self~passthrough(chunk) -- call the public override method end when pos(element~substr(1, 1), xrange('a', 'z') || xrange('A', 'Z')) > 0 then do parse var element tag element + element = element~strip() + if self~debug then + do + call lineout "stderr", errlineidx":"currentSourceLine()":tag =["tag"]" + call lineout "stderr", errlineidx":"currentSourceLine()":element=["element"]" + end -- the following is needed in case the '/' immediately follows the tag if tag~pos('/') > 0 then do tag = tag~substr(1, tag~length - 1) element = '/' element end chunk~tag = tag + chunk~text = raw_element /* process the attributes */ if element~length > 0 then chunk~attr = .directory~new do while element~length() > 0 + -- To increase the chances of parsing success, remove all the spaces before the first quote, if any + -- before: a = " value of a " b = ' value of b ' + -- after : a=" value of a " b = ' value of b ' + firstQuote = element~pos('"') + firstApos = element~pos("'") + if firstQuote <> 0 & firstApos <> 0 then pos = min(firstQuote, firstApos) + else if firstQuote <> 0 then pos = firstQuote + else if firstApos <> 0 then pos = firstApos + else pos = 0 + if pos <> 0 then element = element~left(pos - 1)~space(0) || element~substr(pos) + if self~debug then call lineout "stderr", errlineidx":"currentSourceLine()":element=["element"]" if pos('="', element~word(1)) > 0 then do parse var element attrname '="' attrvalue '"' element attrname = attrname~strip() - attrvalue = attrvalue~strip() + --attrvalue = attrvalue~strip() -- the value between quotes must remain as-is attrvalue = self~xlatetext(attrvalue) chunk~attr[attrname] = attrvalue end else if pos("='", element~word(1)) > 0 then do parse var element attrname "='" attrvalue "'" element attrname = attrname~strip() - attrvalue = attrvalue~strip() + --attrvalue = attrvalue~strip() -- the value between quotes must remain as-is attrvalue = self~xlatetext(attrvalue) chunk~attr[attrname] = attrvalue end @@ -294,6 +371,9 @@ self~start_element(chunk) -- call the public override method if attrname = '/' then do endchunk = .xmlchunk~new + endchunk~line = lineidx + endchunk~col = charidx + endchunk~text = raw_element -- won't be printed as-is (because already printed by start_element), but will be used to decide to print nothing instead of </tag> endchunk~tag = tag self~end_element(endchunk) -- call the public override method end @@ -309,6 +389,8 @@ character = self~getchar() -- skip the '>' return chunk +currentSourceLine: +return SIGL /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ @@ -400,11 +482,13 @@ use strict arg src eof = .false /* make sure this is an xml document */ +/* Not applicable to the SGML files of oorexx if src[1]~pos('<?xml') <> 1 then do errortxt = 'Error: Invalid XML document.' self~error(self~create_error(errortxt, 1, 1)) - return + return "" end +*/ /* parse the xml array */ lineidx = 1 charidx = 1 @@ -430,6 +514,7 @@ return errortxt end lines = tfile~arrayin() +self~detect_eol_style(tfile) -- don't assume that the file has the eol style of the current platform tfile~close() errortxt = self~parse_array(lines) @@ -462,8 +547,9 @@ ::method text attribute -- the text ::method tag attribute -- the xml tag name ::method attr attribute -- the tag attributes +::attribute line -- the start line of the chunk +::attribute col -- the start col of the chunk - /*----------------------------------------------------------------------------*/ /* Method: init */ /* Description: instance initialization */ @@ -481,6 +567,8 @@ self~attr = .nil -- For the start_element method this is an ooRexx directory -- class instance. Each attribute and value is contained in -- the ooRexx directory instance. +self~line = 0 +self~col = 0 return Modified: incubator/DocMusings/railroad/_diary.txt =================================================================== --- incubator/DocMusings/railroad/_diary.txt 2009-07-13 00:37:08 UTC (rev 4911) +++ incubator/DocMusings/railroad/_diary.txt 2009-07-13 01:47:23 UTC (rev 4912) @@ -1,4 +1,37 @@ =============================================================================== +2009 july 11 + +I have a small documentation which gives examples of railroads generated +from DITA syntax diagrams, but I can't remember from where I downloaded it... +In the meantime, remember that : +http://www.ditainfocenter.com/eclipsehelp/index.jsp?topic=/org.ditausers.infomanager.LangSpec1.1/common/pr-d.html +http://en.wikipedia.org/wiki/Syntax_diagram +http://www.cs.man.ac.uk/~pjj/bnf/bnf.html +http://ditaa.sourceforge.net/ + + +=============================================================================== +2009 june 29 + +generate.rex : +No need to iterate over the svg files. Batik rasterizer does that automatically. + +I find that the letters of the keywords are a little bit blurred. +--> Changed the CSS stylesheet to declare stroke-width: 0.0; instead of 0.1 +Since the look is better, changed all the 0.1 to 0.0 + +Another possible improvement : in constants.xml, there is a suggestion to try +diagram_scale=0.28 +diagram_unit=in +This is lot more CPU intensive, and I needed to declare a bigger heap for java. +The resolution is better but the png are bigger and very slow to display. +--> not activated for now. + +To investigate : I see that integer.png has small boxes floating near the symbols. +It's probably because of <synnote>. + + +=============================================================================== 2009 june 28 About Clapham : Modified: incubator/DocMusings/railroad/generate.rex =================================================================== --- incubator/DocMusings/railroad/generate.rex 2009-07-13 00:37:08 UTC (rev 4911) +++ incubator/DocMusings/railroad/generate.rex 2009-07-13 01:47:23 UTC (rev 4912) @@ -1,3 +1,5 @@ +if arg(1) = "svg" then signal svg + -- Generate railroads using Clapham 'java net.hydromatic.clapham.Clapham -d clapham_bnf declarations.bnf' 'java net.hydromatic.clapham.Clapham -d clapham_wsn declarations.wsn' @@ -2,2 +4,3 @@ +svg: -- Generate railroads using com.moldflow.dita.syntaxdiagram2svg @@ -12,10 +15,6 @@ 'declarations.xml', '>'outputdir'/debug.txt 2>&1' -call SysFileTree outputdir"/*.svg", "svgfiles", "FO" BATIK_ROOT = value("BATIK_ROOT",,"ENVIRONMENT") -do i=1 to svgfiles.0 - -- of course, launching the Java VM for each image is not the most efficient technique... - 'java -jar "'BATIK_ROOT'/extensions/batik-rasterizer-ext.jar" -onload "'svgfiles.i'"' -end +'java -Xmx1024M -jar "'BATIK_ROOT'/extensions/batik-rasterizer-ext.jar" -onload 'outputdir'/*.svg' Modified: incubator/DocMusings/railroad/syntaxdiagram2svg/css/syntaxdiagram.css =================================================================== --- incubator/DocMusings/railroad/syntaxdiagram2svg/css/syntaxdiagram.css 2009-07-13 00:37:08 UTC (rev 4911) +++ incubator/DocMusings/railroad/syntaxdiagram2svg/css/syntaxdiagram.css 2009-07-13 01:47:23 UTC (rev 4912) @@ -28,7 +28,7 @@ font-weight: bold; font-size: 8pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } svg[class="syntaxdiagram"] g[class~="var"] text { @@ -38,7 +38,7 @@ font-style: italic; font-size: 8pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } svg[class="syntaxdiagram"] g[class~="delim"] text { @@ -49,7 +49,7 @@ font-weight: normal; font-size: 8pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } svg[class="syntaxdiagram"] g[class~="oper"] text { @@ -60,7 +60,7 @@ font-weight: normal; font-size: 8pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } svg[class="syntaxdiagram"] g[class~="sep"] text { @@ -71,7 +71,7 @@ font-weight: normal; font-size: 8pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } svg[class="syntaxdiagram"] g[class~="repsep"] text { @@ -82,7 +82,7 @@ font-weight: normal; font-size: 8pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } svg[class="syntaxdiagram"] a[class~="fragref"] text { @@ -93,7 +93,7 @@ font-weight: normal; font-size: 8pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } svg[class="syntaxdiagram"] g[class~="note"] text { @@ -102,7 +102,7 @@ font-weight: normal; font-size: 6pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } svg[class="syntaxdiagram"] g[class~="boxed"] > g[class~="note"] text { @@ -111,7 +111,7 @@ font-weight: normal; font-size: 6pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } svg[class="syntaxdiagram"] a[class~="note"] text { @@ -122,7 +122,7 @@ font-weight: normal; font-size: 6pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } svg[class="syntaxdiagram"] a[class~="boxed"] > g[class~="note"] text { @@ -133,5 +133,5 @@ font-weight: normal; font-size: 6pt; stroke: #000000; - stroke-width: 0.1; + stroke-width: 0.0; } Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/DO-conditional.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/DO-repetitor.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/DO.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/Decimal integer.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/Hexadecimal literal.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/IPV4 address in dot form-IPv4-range integer.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/IPV4 address in dot form-decimal digit.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/IPV4 address in dot form.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/MathLoadFuncs.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/RxCalcSqrt.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/URL syntax 1.png =================================================================== (Binary files differ) Modified: incubator/DocMusings/railroad/syntaxdiagram2svg_out/URL syntax 2.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |