diff --git a/topics/grammars/Makefile.include b/topics/grammars/Makefile.grammar similarity index 88% rename from topics/grammars/Makefile.include rename to topics/grammars/Makefile.grammar index 950f562b..affc7eba 100644 --- a/topics/grammars/Makefile.include +++ b/topics/grammars/Makefile.grammar @@ -1,5 +1,6 @@ tooldir = ../../../../shared/tools sdflibdir = ../../../../../sdf-library/trunk/library/languages +hunter = ../../hunter.py clean: rm -f *.bgf *.bnf *.html intermediate.lll tmp.xml *prepared* diff --git a/topics/grammars/Makefile.language b/topics/grammars/Makefile.language new file mode 100644 index 00000000..60758471 --- /dev/null +++ b/topics/grammars/Makefile.language @@ -0,0 +1,29 @@ +extract: + cat ready.lst | xargs -n1 -I _ make _.extract + +%.extract: + cd $* && make extract + +diff: + cat ready.lst | xargs -n1 -I _ make _.diff + +%.diff: + make $*.extract + gdt $*.bgf $*/grammar.bgf || exit -1 + +save: + cat ready.lst | xargs -n1 -I _ make _.save + +%.save: + make $*.extract + cp $*/grammar.bgf $*.bgf + +clean: + cat ready.lst | xargs -n1 -I _ make _.clean + +%.clean: + cd $* && make clean + +test: + ls -1 *.bgf */*.bgf | xargs -n1 ../../../shared/tools/validate bgf + diff --git a/topics/grammars/ada/Makefile b/topics/grammars/ada/Makefile index 913e73f8..922ac8ad 100644 --- a/topics/grammars/ada/Makefile +++ b/topics/grammars/ada/Makefile @@ -1,31 +1 @@ -extract: - cd kempe && make extract - cd kellogg && make extract - cd laemmel-verhoef && make extract - cd lncs-2219 && make extract - cd lncs-4348 && make extract - -clean: - cd kempe && make clean - cd kellogg && make clean - cd laemmel-verhoef && make clean - cd lncs-2219 && make clean - cd lncs-4348 && make clean - -test: - cd kempe && make test - cd kellogg && make test - cd laemmel-verhoef && make test - cd lncs-2219 && make test - cd lncs-4348 && make test - -diff: - make kempe.diff - make kellogg.diff - make laemmel-verhoef.diff - make lncs-2219.diff - make lncs-4348.diff - -%.diff: - cd $* && make extract - ../../../shared/tools/gdts $*/ada.bgf $*.bgf || exit -1 \ No newline at end of file +include ../Makefile.language \ No newline at end of file diff --git a/topics/grammars/ada/kellogg/Makefile b/topics/grammars/ada/kellogg/Makefile index 4b166a79..d2c0ce3a 100644 --- a/topics/grammars/ada/kellogg/Makefile +++ b/topics/grammars/ada/kellogg/Makefile @@ -1,10 +1,7 @@ -all: - extract: - ../../../extraction/antlr/antlrpp.py ada.rsc.g ada.pp.g - java -cp ${CLASSPATH}:../../../../download/antlrworks-1.1.7.jar:../../../extraction/antlr slps.antlr2bgf.Tool ada.pp.g ada.ext.bgf - ../../../../shared/tools/xbgf post-extract.xbgf ada.ext.bgf ada.fix.bgf - ../../../../shared/tools/subgrammar ada.fix.bgf compilation_unit ada.bgf + ../../../extraction/antlr/antlrpp.py ada.rsc.g ada.prepared.g + java -cp ${CLASSPATH}:../../../../download/antlrworks-1.1.7.jar:../../../extraction/antlr slps.antlr2bgf.Tool ada.prepared.g raw.bgf + ${tooldir}/xbgf post-extract.xbgf raw.bgf grammar.bgf + #${tooldir}/subgrammar ext.bgf compilation_unit grammar.bgf -clean: - rm -f ada.pp.g *.bgf +include ../../Makefile.grammar diff --git a/topics/grammars/ada/kellogg/ada.rsc.g b/topics/grammars/ada/kellogg/ada.rsc.g index 03ddcdfc..67d55b63 100644 --- a/topics/grammars/ada/kellogg/ada.rsc.g +++ b/topics/grammars/ada/kellogg/ada.rsc.g @@ -1138,4 +1138,66 @@ LPAREN : '(' ; RPAREN : ')' ; COLON : ':' ; COMMA : ',' ; -SEMI : ';' ; \ No newline at end of file +SEMI : ';' ; + +TIC : '\'' ; + + + + + + + + +IDENTIFIER + : ( 'a'| 'b'| 'c'| 'd'| 'e'| 'f'| 'g'| 'h'| 'i'| 'j'| 'k'| 'l'| 'm'| 'n'| 'o'| 'p'| 'q'| 'r'| 's'| 't'| 'u'| 'v'| 'w'| 'x'| 'y'| 'z' ) ( ('_')? ( 'a'| 'b'| 'c'| 'd'| 'e'| 'f'| 'g'| 'h'| 'i'| 'j'| 'k'| 'l'| 'm'| 'n'| 'o'| 'p'| 'q'| 'r'| 's'| 't'| 'u'| 'v'| 'w'| 'x'| 'y'| 'z'|'0'| '1'| '2'| '3'| '4'| '5'| '6'| '7'| '8'| '9') )* + ; + +CHARACTER_LITERAL : + + '\'' ANY '\'' + ; + +CHAR_STRING : '"' (ANY)* '"' + ; + +NUMERIC_LIT : ( DIGIT )+ + ( '#' BASED_INTEGER ( '.' BASED_INTEGER )? '#' + | ( '_' ( DIGIT )+ )+ + )? + ( + ( '.' ( DIGIT )+ ( '_' ( DIGIT )+ )* ( EXPONENT )? + | EXPONENT + ) + )? + ; + + + +DIGIT : ( '0'| '1'| '2'| '3'| '4'| '5'| '6'| '7'| '8'| '9' ) ; + +EXPONENT : ('e') ('+'|'-')? ( DIGIT )+ ; + +EXTENDED_DIGIT : ( DIGIT | 'a'|'b'|'c'|'d'|'e'|'f' ) ; + +BASED_INTEGER : ( EXTENDED_DIGIT ) ( ('_')? EXTENDED_DIGIT )* ; + + + +WS_ : ( ' ' + | '\t' + | '\f' + + | ( '\r\n' + | '\r' + | '\n' + ) + + ) + + ; + + +COMMENT : ( COMMENT_INTRO (ANY)* ('\n'|'\r'('\n')?) ) + + ; diff --git a/topics/grammars/ada/kellogg/post-extract.xbgf b/topics/grammars/ada/kellogg/post-extract.xbgf index 9c5c3578..cef0781e 100644 --- a/topics/grammars/ada/kellogg/post-extract.xbgf +++ b/topics/grammars/ada/kellogg/post-extract.xbgf @@ -1,6 +1,6 @@ - + EPSILON @@ -9,4 +9,22 @@ + + + + ANY + + + + + + + + + \' + + + ' + + diff --git a/topics/grammars/ada/kempe/Makefile b/topics/grammars/ada/kempe/Makefile index 204bc39e..3f84e621 100644 --- a/topics/grammars/ada/kempe/Makefile +++ b/topics/grammars/ada/kempe/Makefile @@ -1,8 +1,8 @@ extract: cat src.syntax.summary.txt > src.prepared.txt perl -pi -w -e 's/{\|/{TERMINALBAR/g;' src.prepared.txt - ../../hunter.py src.prepared.txt config.edd ada-1.bgf - ${tooldir}/xbgf post-extract.xbgf ada-1.bgf ada-2.bgf - ${tooldir}/xbgf correct.xbgf ada-2.bgf ada.bgf + ${hunter} src.prepared.txt config.edd raw.bgf + ${tooldir}/xbgf post-extract.xbgf raw.bgf ext.bgf + ${tooldir}/xbgf correct.xbgf ext.bgf grammar.bgf -include ../../Makefile.include +include ../../Makefile.grammar diff --git a/topics/grammars/ada/kempe/config.edd b/topics/grammars/ada/kempe/config.edd index d5e8d509..11d6d3c2 100644 --- a/topics/grammars/ada/kempe/config.edd +++ b/topics/grammars/ada/kempe/config.edd @@ -5,8 +5,8 @@ | [ ] - { - } + { + } _ diff --git a/topics/grammars/ada/laemmel-verhoef/Makefile b/topics/grammars/ada/laemmel-verhoef/Makefile index 406a04d6..6d779190 100644 --- a/topics/grammars/ada/laemmel-verhoef/Makefile +++ b/topics/grammars/ada/laemmel-verhoef/Makefile @@ -1,10 +1,5 @@ extract: - ../../hunter.py src.context.free.syntax.txt config.edd ada.raw.bgf - ../../../../shared/tools/xbgf correct.xbgf ada.raw.bgf ada.bgf + ${hunter} src.context.free.syntax.txt config.edd raw.bgf + ${tooldir}/xbgf correct.xbgf raw.bgf grammar.bgf -test: - ls -1 *.bgf | xargs -n1 ../../../../shared/tools/validate bgf - ../../../../shared/tools/checkbgf ada.bgf - -clean: - rm -rf *.bgf *.bnf +include ../../Makefile.grammar diff --git a/topics/grammars/ada/laemmel-verhoef/config.edd b/topics/grammars/ada/laemmel-verhoef/config.edd index 659c31e5..db2479b9 100644 --- a/topics/grammars/ada/laemmel-verhoef/config.edd +++ b/topics/grammars/ada/laemmel-verhoef/config.edd @@ -8,6 +8,6 @@ ) [ ] - { - }* + { + }* diff --git a/topics/grammars/ada/lncs-2219/Makefile b/topics/grammars/ada/lncs-2219/Makefile index 29ff3e84..ede28096 100644 --- a/topics/grammars/ada/lncs-2219/Makefile +++ b/topics/grammars/ada/lncs-2219/Makefile @@ -4,14 +4,8 @@ extract: perl -pi -w -e 's/–/-/g;' src.prepared.txt perl -pi -w -e 's/:\n/: /g;' src.prepared.txt perl -pi -w -e 's/J\./0\./g;' src.prepared.txt - ../../hunter.py src.prepared.txt config.edd ada-1.bgf - ../../../../shared/tools/xbgf post-extract.xbgf ada-1.bgf ada-2.bgf - ../../../../shared/tools/xbgf correct.xbgf ada-2.bgf ada.bgf - ../../../../shared/tools/bgf2bnf ada.bgf ada.bnf + ${hunter} src.prepared.txt config.edd raw.bgf + ${tooldir}/xbgf post-extract.xbgf raw.bgf ext.bgf + ${tooldir}/xbgf correct.xbgf ext.bgf grammar.bgf -test: - ls -1 *.bgf | xargs -n1 ../../../../shared/tools/validate bgf - ../../../../shared/tools/checkbgf ada.bgf - -clean: - rm -f *.bgf *.bnf src.prepared.txt *.html +include ../../Makefile.grammar diff --git a/topics/grammars/ada/lncs-2219/config.edd b/topics/grammars/ada/lncs-2219/config.edd index b6837873..cd3d43db 100644 --- a/topics/grammars/ada/lncs-2219/config.edd +++ b/topics/grammars/ada/lncs-2219/config.edd @@ -5,8 +5,8 @@ | [ ] - { - } + { + } underline digit diff --git a/topics/grammars/ada/lncs-4348/Makefile b/topics/grammars/ada/lncs-4348/Makefile index ba0cc5aa..8a75b209 100644 --- a/topics/grammars/ada/lncs-4348/Makefile +++ b/topics/grammars/ada/lncs-4348/Makefile @@ -3,14 +3,8 @@ extract: perl -pi -w -e 's/{\|/{TERMINALBAR/g;' src.prepared.txt perl -pi -w -e 's/–/-/g;' src.prepared.txt perl -pi -w -e 's/J\./0\./g;' src.prepared.txt - ../../hunter.py src.prepared.txt config.edd ada-1.bgf - ../../../../shared/tools/xbgf post-extract.xbgf ada-1.bgf ada-2.bgf - ../../../../shared/tools/xbgf correct.xbgf ada-2.bgf ada.bgf - ../../../../shared/tools/bgf2bnf ada.bgf ada.bnf + ${hunter} src.prepared.txt config.edd raw.bgf + ${tooldir}/xbgf post-extract.xbgf raw.bgf ext.bgf + ${tooldir}/xbgf correct.xbgf ext.bgf grammar.bgf -test: - ls -1 *.bgf | xargs -n1 ../../../../shared/tools/validate bgf - ../../../../shared/tools/checkbgf ada.bgf - -clean: - rm -f *.bgf *.bnf src.prepared.txt *.html +include ../../Makefile.grammar diff --git a/topics/grammars/ada/lncs-4348/config.edd b/topics/grammars/ada/lncs-4348/config.edd index 7c5ffd94..b4d8faf7 100644 --- a/topics/grammars/ada/lncs-4348/config.edd +++ b/topics/grammars/ada/lncs-4348/config.edd @@ -5,8 +5,8 @@ | [ ] - { - } + { + } underline diff --git a/topics/grammars/ada/ready.lst b/topics/grammars/ada/ready.lst new file mode 100644 index 00000000..f787f48a --- /dev/null +++ b/topics/grammars/ada/ready.lst @@ -0,0 +1,5 @@ +kellogg +kempe +laemmel-verhoef +lncs-2219 +lncs-4348 diff --git a/topics/grammars/cpp/iso-14882-1998/Makefile b/topics/grammars/cpp/iso-14882-1998/Makefile index ac5885d1..6cd2b416 100644 --- a/topics/grammars/cpp/iso-14882-1998/Makefile +++ b/topics/grammars/cpp/iso-14882-1998/Makefile @@ -11,4 +11,7 @@ diff: #../../../../shared/tools/bgf2bnf ada.bgf ada.bnf gdts cpp-1.bgf cpp.raw.bgf +toy: + ../../hunter.py toy.prepared.txt config.edd toy.bgf || exit -1 + include ../../Makefile.include diff --git a/topics/grammars/eiffel/Makefile b/topics/grammars/eiffel/Makefile index 96f71cce..922ac8ad 100644 --- a/topics/grammars/eiffel/Makefile +++ b/topics/grammars/eiffel/Makefile @@ -1,12 +1 @@ -extract: - cd bezault && make extract - cd iso-25436-2006 && make extract - -clean: - cd bezault && make clean - cd iso-25436-2006 && make clean - -test: - cd bezault && make test - cd iso-25436-2006 && make test - +include ../Makefile.language \ No newline at end of file diff --git a/topics/grammars/eiffel/bezault/Makefile b/topics/grammars/eiffel/bezault/Makefile index 55a967a8..81289ec5 100644 --- a/topics/grammars/eiffel/bezault/Makefile +++ b/topics/grammars/eiffel/bezault/Makefile @@ -1,6 +1,6 @@ extract: - ../../hunter.py src.the.syntax.txt config.edd eiffel.raw.bgf - ${tooldir}/xbgf post-extract.xbgf eiffel.raw.bgf eiffel.ext.bgf - ${tooldir}/xbgf complete.xbgf eiffel.ext.bgf eiffel.bgf + ${hunter} src.the.syntax.txt config.edd raw.bgf + ${tooldir}/xbgf post-extract.xbgf raw.bgf ext.bgf + ${tooldir}/xbgf complete.xbgf ext.bgf grammar.bgf -include ../../Makefile.include +include ../../Makefile.grammar diff --git a/topics/grammars/eiffel/bezault/config.edd b/topics/grammars/eiffel/bezault/config.edd index c4504744..b089a868 100644 --- a/topics/grammars/eiffel/bezault/config.edd +++ b/topics/grammars/eiffel/bezault/config.edd @@ -7,10 +7,10 @@ | [ ] - { - ...} - { - ...}+ + { + ...} + { + ...}+ _ diff --git a/topics/grammars/eiffel/iso-25436-2006/Makefile b/topics/grammars/eiffel/iso-25436-2006/Makefile index 7e58e467..5ac9aa11 100644 --- a/topics/grammars/eiffel/iso-25436-2006/Makefile +++ b/topics/grammars/eiffel/iso-25436-2006/Makefile @@ -2,8 +2,8 @@ extract: cp src.manually.fixed.txt src.prepared.txt perl -pi -w -e 's/–/-/g;' src.prepared.txt perl -pi -w -e 's/C\+\+/CPP/g;' src.prepared.txt - ../../hunter.py src.prepared.txt config.edd eiffel-1.bgf - ${tooldir}/xbgf post-extract.xbgf eiffel-1.bgf eiffel-2.bgf - ${tooldir}/xbgf correct.xbgf eiffel-2.bgf eiffel.bgf + ${hunter} src.prepared.txt config.edd raw.bgf + ${tooldir}/xbgf post-extract.xbgf raw.bgf ext.bgf + ${tooldir}/xbgf correct.xbgf ext.bgf grammar.bgf -include ../../Makefile.include +include ../../Makefile.grammar diff --git a/topics/grammars/eiffel/iso-25436-2006/config.edd b/topics/grammars/eiffel/iso-25436-2006/config.edd index eedf9c84..2482eaa4 100644 --- a/topics/grammars/eiffel/iso-25436-2006/config.edd +++ b/topics/grammars/eiffel/iso-25436-2006/config.edd @@ -29,4 +29,8 @@ '"' " + + ' " ' + " + diff --git a/topics/grammars/eiffel/iso-25436-2006/correct.xbgf b/topics/grammars/eiffel/iso-25436-2006/correct.xbgf index 60cd9bce..9c28d117 100644 --- a/topics/grammars/eiffel/iso-25436-2006/correct.xbgf +++ b/topics/grammars/eiffel/iso-25436-2006/correct.xbgf @@ -56,4 +56,25 @@ " + + + + . + + + . + + + Agent_qualified + + + + + + - - + + + -- + + diff --git a/topics/grammars/eiffel/ready.lst b/topics/grammars/eiffel/ready.lst new file mode 100644 index 00000000..212529df --- /dev/null +++ b/topics/grammars/eiffel/ready.lst @@ -0,0 +1,2 @@ +bezault +iso-25436-2006 diff --git a/topics/grammars/hunter.py b/topics/grammars/hunter.py index 36b8b44d..e05b9fef 100755 --- a/topics/grammars/hunter.py +++ b/topics/grammars/hunter.py @@ -25,14 +25,15 @@ 'END-GROUP-SYMBOL', 'START-OPTION-SYMBOL', 'END-OPTION-SYMBOL', - 'START-STAR-SYMBOL', - 'END-STAR-SYMBOL', - 'START-PLUS-SYMBOL', - 'END-PLUS-SYMBOL', + 'START-REPETITION-STAR-SYMBOL', + 'END-REPETITION-STAR-SYMBOL', + 'START-REPETITION-PLUS-SYMBOL', + 'END-REPETITION-PLUS-SYMBOL', 'START-SEPLIST-STAR-SYMBOL', 'END-SEPLIST-STAR-SYMBOL', 'START-SEPLIST-PLUS-SYMBOL', 'END-SEPLIST-PLUS-SYMBOL', + 'POSTFIX-OPTIONALITY-SYMBOL', 'POSTFIX-REPETITION-STAR-SYMBOL', 'POSTFIX-REPETITION-PLUS-SYMBOL', 'UNDEFINED-NONTERMINALS-ARE-TERMINALS', @@ -44,7 +45,7 @@ ] def isAlpha(x): - return reduce(lambda a,b:a and b=='_' or b.isalnum(),x,True) + return reduce(lambda a,b:a and (b=='_' or b=='-' or b.isalnum()),x,True) def isQNumber(x): if x =='.': @@ -75,9 +76,6 @@ def removeComments(ts,s,e): return ts def splitTokenStream(s): - global debug - if debug: - print('Token stream:',list(s)) ts = [s[0]] i = 1 alpha = isAlpha(s[0]) @@ -425,13 +423,14 @@ def startOfContext(a,i,s): return j def map2expr(ss): - global debug + #global debug + debug = False ess = [] es = [] i = 0 while i1 and k.find('@@@')<0: print('STEP 1: going to glue tokens that resemble masked terminal', k.replace('\n','\\n')) tokens = mapglue(tokens,k) + if debug: + print('Token stream:',tokens) + tokens = splitTokenStream(tokens) + if 'start-comment-symbol' in config.keys() and 'end-comment-symbol' in config.keys(): + # remove comments + # assumption: comments are never nested! + tokens = removeComments(mapglue(mapglue(tokens,config['start-comment-symbol']),config['end-comment-symbol']),config['start-comment-symbol'],config['end-comment-symbol']) + if debug: + print('Token stream:',tokens) if 'start-terminal-symbol' in config.keys() and 'end-terminal-symbol' in config.keys(): tokens = [config['start-terminal-symbol']+masked[x]+config['end-terminal-symbol'] if x in masked.keys() else x for x in tokens] tokens = assembleBracketedSymbols(tokens,config['start-terminal-symbol'],config['end-terminal-symbol']) @@ -934,7 +939,7 @@ def considerIndentation(ts): else x for x in tokens] if debug: - print(tokens) + print('Token stream:',tokens) # STEP 2: assemble nonterminal symbols print('STEP 2: assembling nonterminal symbols.') if 'start-nonterminal-symbol' in config.keys() and 'end-nonterminal-symbol' in config.keys(): @@ -943,7 +948,7 @@ def considerIndentation(ts): print('STEP 2 skipped, sorry: start-nonterminal-symbol and end-nonterminal-symbol are not both specified.') # STEP 3: assembling composite metasymbols together if debug: - print(tokens) + print('Token stream:',tokens) print('STEP 3: assembling metasymbols according to their possible values.') tokens = assembleQualifiedNumbers(tokens) for k in config.keys(): @@ -951,7 +956,7 @@ def considerIndentation(ts): print('STEP 3: going to glue tokens that resemble metasymbol', config[k].replace('\n','\\n').replace('\t','\\t'),'('+k+')') tokens = mapglue(tokens,config[k]) if debug: - print(tokens) + print('Token stream:',tokens) # STEP 4: slice according to defining-symbol print('STEP 4: splitting the token stream into productions.') if 'consider-indentation' in config.keys(): @@ -960,7 +965,7 @@ def considerIndentation(ts): if debug: print('After considering indentation:',tokens) if debug: - print(tokens) + print('Token stream:',tokens) if 'nonterminals-may-contain-spaces' in config.keys() and 'concatenate-symbol' in config.keys(): # can only treat them together, because spaces in names without concatenation symbol are highly ambiguous # and concatenation symbols are never used if nonterminal names do not have spaces @@ -1004,9 +1009,11 @@ def considerIndentation(ts): config['terminator-symbol'] = ts[0] else: # ORLY? - print('STEP 4 unsuccessful, sorry.') + print('STEP 4 unsuccessful, sorry: will assume terminator-symbol to be empty.') for p in prods: print('%40s'%p[1],'>>>>>>',p[-2:]) + config['terminator-symbol'] = '' + need2fix = [] # STEP 4a.2: adjusting the terminator-symbol on the unfit productions poststep4 = 0 if debug: @@ -1040,7 +1047,23 @@ def considerIndentation(ts): prods = [p[:-(len(config['terminator-symbol']))] if p[-(len(config['terminator-symbol'])):] == config['terminator-symbol'] else p for p in prods] # STEP 5: slice insides according to definition-separator-symbol step5 = False - for s in ('definition-separator-symbol','postfix-repetition-star-symbol','postfix-repetition-plus-symbol','start-group-symbol','end-group-symbol','start-star-symbol','end-star-symbol','start-plus-symbol','end-plus-symbol','start-seplist-star-symbol','end-seplist-star-symbol','start-seplist-plus-symbol','end-seplist-plus-symbol','start-option-symbol','end-option-symbol'): + for s in \ + ('definition-separator-symbol' + ,'postfix-repetition-star-symbol' + ,'postfix-repetition-plus-symbol' + ,'postfix-optionality-symbol' + ,'start-group-symbol' + ,'end-group-symbol' + ,'start-repetition-star-symbol' + ,'end-repetition-star-symbol' + ,'start-repetition-plus-symbol' + ,'end-repetition-plus-symbol' + ,'start-seplist-star-symbol' + ,'end-seplist-star-symbol' + ,'start-seplist-plus-symbol' + ,'end-seplist-plus-symbol' + ,'start-option-symbol' + ,'end-option-symbol'): if s in config.keys(): print('STEP 5: marking',s+'.') step5 = True diff --git a/topics/grammars/metasyntax/ebnf-iso-1/config.edd b/topics/grammars/metasyntax/ebnf-iso-1/config.edd index 0b545b69..0c3c28ac 100644 --- a/topics/grammars/metasyntax/ebnf-iso-1/config.edd +++ b/topics/grammars/metasyntax/ebnf-iso-1/config.edd @@ -11,8 +11,8 @@ [ ] - { - } + { + } diff --git a/topics/grammars/metasyntax/ebnf-iso-2/config.edd b/topics/grammars/metasyntax/ebnf-iso-2/config.edd index 0b545b69..0c3c28ac 100644 --- a/topics/grammars/metasyntax/ebnf-iso-2/config.edd +++ b/topics/grammars/metasyntax/ebnf-iso-2/config.edd @@ -11,8 +11,8 @@ [ ] - { - } + { + } diff --git a/topics/grammars/metasyntax/ebnf-iso-3/config.edd b/topics/grammars/metasyntax/ebnf-iso-3/config.edd index 0d29f830..78f57556 100644 --- a/topics/grammars/metasyntax/ebnf-iso-3/config.edd +++ b/topics/grammars/metasyntax/ebnf-iso-3/config.edd @@ -11,8 +11,8 @@ (/ /) - (: - :) + (: + :) diff --git a/topics/grammars/modula/Makefile b/topics/grammars/modula/Makefile index 995b2122..922ac8ad 100644 --- a/topics/grammars/modula/Makefile +++ b/topics/grammars/modula/Makefile @@ -1,11 +1 @@ -extract: - cd sdf && make extract - cd src-052 && make extract - -clean: - cd sdf && make clean - cd src-052 && make clean - -test: - cd sdf && make test - cd src-052 && make test +include ../Makefile.language \ No newline at end of file diff --git a/topics/grammars/modula/ready.lst b/topics/grammars/modula/ready.lst new file mode 100644 index 00000000..9639e22c --- /dev/null +++ b/topics/grammars/modula/ready.lst @@ -0,0 +1,2 @@ +sdf +src-052 diff --git a/topics/grammars/modula/sdf/Makefile b/topics/grammars/modula/sdf/Makefile index d489d04e..efc6bd1d 100644 --- a/topics/grammars/modula/sdf/Makefile +++ b/topics/grammars/modula/sdf/Makefile @@ -1,6 +1,6 @@ extract: - ${tooldir}/sdf2bgf ${sdflibdir}/modula-3/syntax/*.sdf modula.ext.bgf - ${tooldir}/subgrammar modula.ext.bgf Compilation modula.ext.2.bgf - ${tooldir}/xbgf refactor.xbgf modula.ext.2.bgf modula.bgf + ${tooldir}/sdf2bgf ${sdflibdir}/modula-3/syntax/*.sdf raw.bgf + ${tooldir}/subgrammar raw.bgf Compilation ext.bgf + ${tooldir}/xbgf refactor.xbgf ext.bgf grammar.bgf -include ../../Makefile.include \ No newline at end of file +include ../../Makefile.grammar \ No newline at end of file diff --git a/topics/grammars/modula/src-052/Makefile b/topics/grammars/modula/src-052/Makefile index 24702bf3..97e286c2 100644 --- a/topics/grammars/modula/src-052/Makefile +++ b/topics/grammars/modula/src-052/Makefile @@ -1,4 +1,5 @@ extract: - ../../hunter.py src.manually.fixed.txt config.edd modula.bgf + ${hunter} src.manually.fixed.txt config.edd raw.bgf + ${tooldir}/xbgf refactor.xbgf raw.bgf grammar.bgf -include ../../Makefile.include \ No newline at end of file +include ../../Makefile.grammar diff --git a/topics/grammars/modula/src-052/config.edd b/topics/grammars/modula/src-052/config.edd index 52992f68..0eaadb15 100644 --- a/topics/grammars/modula/src-052/config.edd +++ b/topics/grammars/modula/src-052/config.edd @@ -9,8 +9,8 @@ ) [ ] - { - } + { + } E1 E2 diff --git a/topics/grammars/modula/src-052/refactor.xbgf b/topics/grammars/modula/src-052/refactor.xbgf new file mode 100644 index 00000000..17beed4e --- /dev/null +++ b/topics/grammars/modula/src-052/refactor.xbgf @@ -0,0 +1,49 @@ + + + + + + + Digit + + + + + Digit + + + + + + + + + Digit + + + + + + + + + HexDigit + + + + + HexDigit + + + + + + + + + HexDigit + + + + +