1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
%%%
%% Section 8.8: Constructor Declarations
%%
%% @author Martin Bravenboer <martin@cs.uu.nl>
%%%
module languages/java-14/classes/ConstructorDeclarations
imports
languages/java-14/lexical/Identifiers
languages/java-14/lexical/Modifiers
languages/java-14/statements/Main
languages/java-14/expressions/Main
exports
sorts
ConstrDec
ConstrBody
ConstrHead
ConstrInv
context-free syntax
ConstrHead ConstrBody -> ConstrDec {cons("ConstrDec")}
ConstrMod* Id "(" {FormalParam ","}* ")" Throws? -> ConstrHead {cons("ConstrDecHead")}
"{" ConstrInv? BlockStm* "}" -> ConstrBody {cons("ConstrBody")}
"this" "(" {Expr ","}* ")" ";" -> ConstrInv {cons("AltConstrInv")}
"super" "(" {Expr ","}* ")" ";" -> ConstrInv {cons("SuperConstrInv")}
Expr "." "super" "(" {Expr ","}* ")" ";" -> ConstrInv {cons("QSuperConstrInv")}
sorts ConstrMod
context-free syntax
Public -> ConstrMod
Protected -> ConstrMod
Private -> ConstrMod
|