Skip to content

Commit

Permalink
major breakthrough in Ada grammars
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@1033 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed May 18, 2011
1 parent 4c57fc6 commit 44a3610
Show file tree
Hide file tree
Showing 24 changed files with 2,760 additions and 17 deletions.
8 changes: 8 additions & 0 deletions topics/grammars/ada/ichbiah/README.txt
@@ -0,0 +1,8 @@
J. D. Ichbiah, Preliminary Ada reference manual
ACM SIGPLAN Notices, Volume 14 Issue 6a, June 1979

http://dx.doi.org/10.1145/956650.956651
http://portal.acm.org/citation.cfm?id=956651

Appendix E: Syntax Summary, pages E-1..E-5

18 changes: 18 additions & 0 deletions topics/grammars/ada/ichbiah/src.syntax.summary.txt
@@ -0,0 +1,18 @@
2.3
1dent1f1er ::=1etter {[under5c0reJ 1etter•0r•d191t}
1etter•0r•d191t ::= 1etter 1 d191t
1etter ::= upper•ca5e•1etter2.4num6er ::= 1nte9er•num6er1nte9er•num6er ::= 1nte9er1nte9er ::= d191t {[under5c0reJ d191t}6a5ed•1nte9er ::=
1 10wer•ca5e•1etter
6a~;e # extended•d191t {[under5c0re[ extended•d191t}6a5e ::= 1nte9erextended•d191t ::= d191t 1 1etter
appr0x1mate•num6er ::=1nte9er.1nte9er 1E exp0nent[
1 1nte9er E exp0nentexp0nent ::= [+J 1nte9er 1 - 1nte9er
2.5character•5tr1n9 ::= • {character} "
2.7pra9ma ::=
pra9ma 1dent1f1er [(ar9ument {, ar9ument})J;ar9ument ::= 1dent1f1er 1 character•5tr1n9 1 num6er
1 appr0x1mate•num6er1 6a5ed•1nte9er
3.1
dec1arat10n ::=06ject•dec1arat10n
1 5u6type•dec1arat10n1 5u6pr09ram•dec1arat10n1 entry~dec~arat10n1 renam1n9•dec1arat10n
3.206ject•dec1arat10n ::=
1 type•dec1arat10n1 pr1vate•type•dec1arat10n1 m0du1e•dec1arat10n1 except10n•dec1arat10n
1dent1f1er•115t : [¢0n5tantJ type [:= expre5510nj;1dent1f1er•115t ::= 1dent1f1er 1, 1dent1f1er}
@@ -1,16 +1,16 @@
all:
make iso-ada-fix.bgf
make ada.bgf

iso-ada-fix.bgf: iso-ada.bgf
ada.bgf: iso-ada-1.bgf
../../../../shared/tools/xbgf post-extract.xbgf iso-ada-1.bgf iso-ada-2.bgf
../../../../shared/tools/xbgf nt2t.xbgf iso-ada-2.bgf iso-ada-3.bgf
../../../../shared/tools/xbgf correct.xbgf iso-ada-3.bgf iso-ada-fix.bgf
../../../../shared/tools/checkbgf iso-ada-fix.bgf
../../../../shared/tools/xbgf correct.xbgf iso-ada-3.bgf ada.bgf
../../../../shared/tools/checkbgf ada.bgf

iso-ada.bgf: iso-grammar.txt
iso-ada-1.bgf: iso-grammar.txt keywords.lst
../../../../shared/tools/lll2bgf iso-grammar.txt iso-ada-1.bgf
../../../../shared/tools/validate bgf iso-ada-1.bgf || exit -1
../../../../shared/python/keywords2xbgf.py

clean:
rm -f iso-ada-?.bgf
rm -f iso-ada-?.bgf ada.bgf nt2t.xbgf
@@ -1,4 +1,5 @@
Source: Ada 95 Reference Manual
Magnus Kempe -- Magnus.Kempe@di.epfl.ch
http://www-users.cs.york.ac.uk/~andy/lrm95/toc.htm

This is a hypertext version of the revised international standard (ISO/IEC 8652:1995): Information Technology -- Programming Languages -- Ada. The entry point is the table of contents (TOC), with three "zoom levels."
Expand All @@ -7,8 +8,3 @@ This is a hypertext version of the revised international standard (ISO/IEC 8652:

Annex P: Syntax Summary
http://www-users.cs.york.ac.uk/~andy/lrm95/p.htm


See also:
http://www.cs.vu.nl/grammarware/ada/

File renamed without changes.
File renamed without changes.
Expand Up @@ -491,7 +491,7 @@ aggregate:
;

record_aggregate:
(record_component_association_list)
"(" record_component_association_list ")"
;

record_component_association_list:
Expand All @@ -509,7 +509,7 @@ component_choice_list:
;

extension_aggregate:
(ancestor_part with record_component_association_list)
"(" ancestor_part with record_component_association_list ")"
;

ancestor_part:
Expand Down Expand Up @@ -674,7 +674,7 @@ statement_identifier:
;

assignment_statement:
variable_name ASSUMES expression
variable_name ASSUMES expression ";"
;

if_statement:
Expand Down Expand Up @@ -704,6 +704,7 @@ case_statement_alternative:
;

loop_statement:
(loop_statement_identifier ":")?
( iteration_scheme )? loop
sequence_of_statements
end loop ( loop_identifier )? ";"
Expand All @@ -719,6 +720,7 @@ loop_parameter_specification:
;

block_statement:
(block_statement_identifier ":")?
( declare
declarative_part )?
begin
Expand Down Expand Up @@ -1189,7 +1191,7 @@ protected_body_stub:
;

subunit:
separate (parent_unit_name) proper_body
separate "(" parent_unit_name ")" proper_body
;

exception_declaration:
Expand All @@ -1204,6 +1206,7 @@ handled_sequence_of_statements:
;

exception_handler:
when (choice_parameter_specification ":")? exception_choice ("|" exception_choice)* "=>"
sequence_of_statements
;

Expand Down Expand Up @@ -1420,4 +1423,5 @@ at_clause:
;

mod_clause:
at mod static_expression;
at mod static_expression ";"
;
Expand Up @@ -4,6 +4,7 @@ abs
abstract
accept
access
Access
aliased
all
and
Expand All @@ -15,6 +16,9 @@ constant
declare
delay
delta
Delta
Digits
digits
do
else
elsif
Expand Down Expand Up @@ -44,6 +48,7 @@ private
procedure
protected
raise
Range
record
rem
renames
Expand Down
Expand Up @@ -29,7 +29,17 @@
<nonterminal>UNKNOWNDP</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>(&lt;&gt;)</terminal>
<sequence>
<bgf:expression>
<terminal>(</terminal>
</bgf:expression>
<bgf:expression>
<terminal>&lt;&gt;</terminal>
</bgf:expression>
<bgf:expression>
<terminal>)</terminal>
</bgf:expression>
</sequence>
</bgf:expression>
</xbgf:replace>
<xbgf:inline>pragmaINLINE</xbgf:inline>
Expand Down
7 changes: 7 additions & 0 deletions topics/grammars/ada/laemmel-verhoef/Makefile
@@ -0,0 +1,7 @@
all:
./extract.py src.context.free.syntax.txt config.edd ada.bgf
validate bgf ada.bgf
checkbgf ada.bgf

clean:
rm -rf *.bgf *.bnf
15 changes: 15 additions & 0 deletions topics/grammars/ada/laemmel-verhoef/README.txt
@@ -0,0 +1,15 @@
iBrowsable Ada 95 Grammar
Copyright (C) 2000 Ralf Lämmel (CWI, Amsterdam) & Chris Verhoef (Free University, Amsterdam)

Full copyright information including the copyright information for the underlying Ada 95 Reference Manual are found here.

This grammar has been derived from the Ada 95 Reference Manual.
Lexical and context-free syntax has been separated.
Some informal explanations have been implemented in the lexical syntax.
The nonterminal range has been renamed to range_definition to avoid collision with the keyword range.
There are many unresolved bottom sorts carrying over from the Ada 95 RM.

If you have any remark or a question, contact Ralf Lämmel (Email: ralf@cwi.nl)
This is Version 1.0 of the grammar. It has been released on December, 7th, 2000.

http://www.cs.vu.nl/grammarware/ada/
13 changes: 13 additions & 0 deletions topics/grammars/ada/laemmel-verhoef/config.edd
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<edd:config xmlns:edd="http://planet-sl.org/edd">
<defining-symbol>=</defining-symbol>
<definition-separator-symbol>|</definition-separator-symbol>
<start-terminal-symbol>"</start-terminal-symbol>
<end-terminal-symbol>"</end-terminal-symbol>
<start-group-symbol>(</start-group-symbol>
<end-group-symbol>)</end-group-symbol>
<start-option-symbol>[</start-option-symbol>
<end-option-symbol>]</end-option-symbol>
<start-repeat-symbol>{</start-repeat-symbol>
<end-repeat-symbol>}*</end-repeat-symbol>
</edd:config>

0 comments on commit 44a3610

Please sign in to comment.