Changeset 458
- Timestamp:
- Jul 7, 2010 1:18:56 AM (14 years ago)
- Location:
- trunk/metaxa/src
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/metaxa/src/Magnolia/BaseExtMix.sdf
r450 r458 31 31 MorphClause => MorphClause[[Ctx0]] 32 32 Morphism => Morphism[[Ctx0]] 33 ImplExpr => ImplExpr[[Ctx0]]34 33 ConceptExpr => ConceptExpr[[Ctx0]] 35 34 WithClause => WithClause[[Ctx0]] 36 35 GuardClause => GuardClause[[Ctx0]] 37 36 Attribute => Attribute[[Ctx0]] 38 SubClause => SubClause[[Ctx0]]39 37 AttrClause => AttrClause[[Ctx0]] 40 38 DeclDeclarative => DeclDeclarative[[Ctx0]] 41 DeclName => DeclName[[Ctx0]]42 39 DeclClause => DeclClause[[Ctx0]] 40 TypeIdentifier => TypeIdentifier[[Ctx0]] 41 TypeName => TypeName[[Ctx0]] 43 42 TypeDeclarative => TypeDeclarative[[Ctx0]] 44 TypeName => TypeName[[Ctx0]]45 43 TypeClause => TypeClause[[Ctx0]] 46 44 VarName => VarName[[Ctx0]] 45 VarIdentifier => VarIdentifier[[Ctx0]] 47 46 VarClause => VarClause[[Ctx0]] 48 47 ParamMode => ParamMode[[Ctx0]] 49 48 ProcedureParam => ProcedureParam[[Ctx0]] 50 49 FunctionParam => FunctionParam[[Ctx0]] 51 TypeParam => TypeParam[[Ctx0]]52 50 ProcedureParamList => ProcedureParamList[[Ctx0]] 53 51 FunctionParamList => FunctionParamList[[Ctx0]] 54 TypeParamList => TypeParamList[[Ctx0]]52 AxiomIdentifier => AxiomIdentifier[[Ctx0]] 55 53 AxiomName => AxiomName[[Ctx0]] 56 54 AxiomClause => AxiomClause[[Ctx0]] 57 PredName => PredName[[Ctx0]]58 55 PredClause => PredClause[[Ctx0]] 56 FunIdentifier => FunIdentifier[[Ctx0]] 59 57 ExprDeclarative => ExprDeclarative[[Ctx0]] 60 58 FunClause => FunClause[[Ctx0]] 59 ProcIdentifier => ProcIdentifier[[Ctx0]] 61 60 StatDeclarative => StatDeclarative[[Ctx0]] 62 61 ProcClause => ProcClause[[Ctx0]] 62 SubClause => SubClause[[Ctx0]] 63 63 DeclBody => DeclBody[[Ctx0]] 64 64 Decl => Decl[[Ctx0]] … … 94 94 Program => Program[[Ctx0]] 95 95 Type => Type[[Ctx0]] 96 ImplExpr => ImplExpr[[Ctx0]] 96 97 Expr => Expr[[Ctx0]] ] -
trunk/metaxa/src/Magnolia/Core/Declarations.sdf
r457 r458 68 68 context-free syntax 69 69 70 StatDeclarative SubClause* BlockStat70 Modifier* StatDeclarative SubClause* BlockStat 71 71 -> BraceDecl 72 72 {cons("DefDecl")} 73 73 74 ExprDeclarative SubClause* "=" Expr ";"74 Modifier* ExprDeclarative SubClause* "=" Expr ";" 75 75 -> SemiDecl 76 76 {cons("DefDecl")} 77 77 78 TypeDeclarative SubClause* "=" Type ";"78 Modifier* TypeDeclarative SubClause* "=" Type ";" 79 79 -> Decl 80 80 {cons("DefDecl")} 81 81 82 DeclDeclarative SubClause* DeclBody82 Modifier* DeclDeclarative SubClause* DeclBody 83 83 -> BraceDecl 84 84 {cons("DefDecl")} … … 92 92 "external" -> SubClause 93 93 94 "default" -> Modifier 95 96 "abstract" -> Modifier 97 94 98 %%% Procedure Declarations 95 99 sorts 96 ProcClause ProcName 97 98 context-free syntax 99 100 "procedure" Proc NameProcedureParamList100 ProcClause ProcName ProcIdentifier 101 102 context-free syntax 103 104 "procedure" ProcIdentifier ProcedureParamList 101 105 -> ProcClause 102 106 {cons("ProcClause")} … … 104 108 ProcClause -> StatDeclarative 105 109 106 Name -> ProcName 107 108 "_=_" -> ProcName {cons("Assign")} 110 Identifier -> ProcIdentifier 111 112 Name -> ProcName 113 114 "_=_" -> ProcIdentifier {cons("Assign")} 109 115 110 116 lexical restrictions … … 115 121 %%% Function Declarations 116 122 sorts 117 FunClause FunName 118 119 context-free syntax 120 121 "function" Fun NameFunctionParamList ":" Type123 FunClause FunName FunIdentifier 124 125 context-free syntax 126 127 "function" FunIdentifier FunctionParamList ":" Type 122 128 -> FunClause {cons("FunClause")} 123 129 124 130 FunClause -> ExprDeclarative 125 131 126 Name -> FunName 127 132 Identifier -> FunIdentifier 133 134 Name -> FunName 135 128 136 lexical restrictions 129 137 … … 136 144 context-free syntax 137 145 138 "predicate" PredNameFunctionParamList146 "predicate" FunIdentifier FunctionParamList 139 147 -> PredClause {cons("PredClause")} 140 148 141 149 PredClause -> ExprDeclarative 142 150 143 Name -> PredName144 145 151 lexical restrictions 146 152 … … 150 156 %%% Axiom Declarations 151 157 sorts 152 AxiomClause AxiomName 153 154 context-free syntax 155 156 "axiom" AxiomNameFunctionParamList158 AxiomClause AxiomName AxiomIdentifier 159 160 context-free syntax 161 162 "axiom" Identifier FunctionParamList 157 163 -> AxiomClause {cons("AxiomClause")} 158 164 159 "theorem" AxiomNameFunctionParamList165 "theorem" Identifier FunctionParamList 160 166 -> AxiomClause {cons("AxiomClause")} 161 167 162 "proof" AxiomNameFunctionParamList168 "proof" Identifier FunctionParamList 163 169 -> AxiomClause {cons("AxiomClause")} 164 170 … … 166 172 167 173 Name -> AxiomName 174 175 Identifier -> AxiomIdentifier 168 176 169 177 lexical restrictions … … 181 189 context-free syntax 182 190 183 "(" {TypeParam ","}* ")" -> TypeParamList {cons("Dummy")}191 %% "(" {TypeParam ","}* ")" -> TypeParamList {cons("Dummy")} 184 192 185 193 "(" {FunctionParam ","}* ")"-> FunctionParamList {cons("Dummy")} … … 187 195 "(" {ProcedureParam ","}* ")"-> ProcedureParamList {cons("Dummy")} 188 196 189 Type -> TypeParam {cons("TypeExprParam")}190 191 Type Identifier -> TypeParam {cons("TypeExprParam")}192 193 "type" -> TypeParam {cons("AnonTypeParam")}194 195 "type" Identifier -> TypeParam {cons("TypeParam")}196 197 "type" TypeParamList -> TypeParam {cons("AnonTypePParam")}198 199 "type" Identifier TypeParamList -> TypeParam {cons("TypePParam")}200 201 Identifier ":" Type -> FunctionParam {cons("Param")}202 203 ParamMode Identifier ":" Type -> ProcedureParam {prefer, cons("Param")}197 %% Type -> TypeParam {cons("TypeExprParam")} 198 199 %% Type Identifier -> TypeParam {cons("TypeExprParam")} 200 201 %% "type" -> TypeParam {cons("AnonTypeParam")} 202 203 %% "type" Identifier -> TypeParam {cons("TypeParam")} 204 205 %% "type" TypeParamList -> TypeParam {cons("AnonTypePParam")} 206 207 %% "type" Identifier TypeParamList -> TypeParam {cons("TypePParam")} 208 209 VarIdentifier ":" Type -> FunctionParam {cons("Param")} 210 211 ParamMode VarIdentifier ":" Type -> ProcedureParam {prefer, cons("Param")} 204 212 205 213 "obs" -> ParamMode {cons("Obs")} … … 225 233 %%% Variables 226 234 227 sorts VarClause Var Name228 229 context-free syntax 230 231 "var" Var Name":" Type -> VarClause {cons("VarClause")}235 sorts VarClause VarIdentifier VarName 236 237 context-free syntax 238 239 "var" VarIdentifier ":" Type -> VarClause {cons("VarClause")} 232 240 233 241 VarClause -> ExprDeclarative 234 242 235 Name -> VarName 236 243 Identifier -> VarIdentifier 244 245 Name -> VarName 246 237 247 lexical restrictions 238 248 … … 242 252 243 253 sorts 244 TypeName TypeClause 245 246 context-free syntax 247 248 "type" TypeName -> TypeClause {cons("TypeClause")} 249 250 Name -> TypeName 254 TypeClause TypeName TypeIdentifier 255 256 context-free syntax 257 258 "type" TypeIdentifier -> TypeClause {cons("TypeClause")} 251 259 252 260 TypeClause -> TypeDeclarative 253 261 262 Name -> TypeName 263 264 Identifier -> TypeIdentifier 265 254 266 lexical restrictions 255 267 … … 259 271 260 272 sorts 261 DeclName DeclClause 262 263 context-free syntax 264 265 "concept" DeclName SubClause* "=" ConceptExpr -> Decl {cons("ConceptClause")} 266 %% "theorem" DeclName -> DeclClause {cons("ConceptClause")} 267 "implementation" DeclName "on" ConceptExpr "defines" -> DeclClause {cons("ImplClause")} 268 "signature" DeclName -> DeclClause {cons("SignatureClause")} 273 DeclClause 274 275 context-free syntax 276 277 Modifier* "concept" Identifier SubClause* "=" ConceptExpr -> Decl {cons("ConceptClause")} 278 %% "theorem" Identifier -> DeclClause {cons("ConceptClause")} 279 Modifier* "implementation" Identifier SubClause* "=" ImplExpr -> Decl {cons("ImplClause")} 269 280 270 "library" DeclName SubClause* "=" ImplExpr -> Decl {cons("Library")} 271 272 Identifier -> DeclName 273 281 Modifier* "library" Identifier SubClause* "=" ImplExpr -> Decl {cons("Library")} 282 283 Modifier* "concept" Identifier SubClause* DeclBody -> Decl {deprecated("Add '=' before body"), cons("ConceptClause")} 284 285 Modifier* "implementation" Identifier SubClause* ImplExpr -> Decl {deprecated("Add '=' before body"), cons("ImplClause")} 286 274 287 DeclClause -> DeclDeclarative 275 288 … … 278 291 "concept" -/- [A-Za-z\_\$0-9] 279 292 %% "theorem" -/- [A-Za-z\_\$0-9] 280 " module" -/- [A-Za-z\_\$0-9]281 " signature" -/- [A-Za-z\_\$0-9]293 "implementation" -/- [A-Za-z\_\$0-9] 294 "library" -/- [A-Za-z\_\$0-9] 282 295 283 296 %%% Declaration Attributes … … 315 328 "requires" {ConceptExpr ","}+ ";" -> Decl {cons("Requires")} 316 329 330 %% TODO: What are these supposed to be? 331 "preserve" DeclBody -> Decl {todo("Grammar needs refinement")} 332 333 "congruence" DeclBody -> Decl {todo("Grammar needs refinement")} 334 335 317 336 318 337 lexical restrictions … … 341 360 342 361 343 "satisfaction" DeclName "=" ConceptExpr WithClause? "models" ConceptExpr ";" -> Decl {cons("ModelsImpl")} 362 "satisfaction" Identifier SubClause* "=" ConceptExpr WithClause? "models" ConceptExpr -> Decl {cons("ModelsImpl")} 363 364 "satisfaction" Identifier SubClause* "=" "on" ConceptExpr WithClause? "models" ConceptExpr -> Decl {deprecated("Drop 'on'"), cons("ModelsImpl")} 344 365 345 366 "with" ImplExpr -> WithClause {cons("WithClause")} 346 367 347 DeclName -> ConceptExpr {cons("Concept")}368 Name -> ConceptExpr {cons("Concept")} 348 369 349 370 DeclBody -> ConceptExpr {cons("ConceptBody")} 350 371 351 372 "signature" ConceptExpr -> ConceptExpr {cons("SignatureOf")} 352 373 353 374 ConceptExpr Morphism -> ConceptExpr {cons("MorphedConcept")} 354 375 355 DeclName -> ImplExpr {cons("Impl")}376 Name -> ImplExpr {cons("Impl")} 356 377 357 378 ImplExpr Morphism -> ImplExpr {cons("ImplMorph")} … … 359 380 DeclBody -> ImplExpr {cons("ImplBody")} 360 381 382 %% TODO: Needs refinement 383 361 384 "external" Identifier Name "defines" ImplExpr -> ImplExpr {cons("ExternalLib")} 362 385 386 "external" Identifier Name "on" ConceptExpr "defines" ImplExpr -> ImplExpr {cons("ExternalLib")} 387 388 "on" ConceptExpr "defines" ImplExpr -> ImplExpr {cons("OnDefines")} 389 363 390 %% Morphisms 364 391 context-free syntax … … 368 395 "morphism" MorphClause -> SubClause {cons("Morphism")} 369 396 370 "protect" FunClause "by" Expr -> Morphism {cons("Protect")} 397 "{" MorphClause* "}" -> MorphClause {todo("clean up syntax for list of morph clauses"), cons("ImplMorphism")} 398 399 "{" (MorphClause ";")* "}" -> MorphClause {todo("clean up syntax for list of morph clauses"), cons("ImplMorphism")} 371 400 372 401 "[" {MorphClause ","}* "]" -> Morphism {cons("Morphisms")} 373 402 374 DeclName "=>" DeclName -> MorphClause {cons("Rename")}403 Name "=>" Name -> MorphClause {cons("Rename")} 375 404 376 405 TypeClause "=" Type -> MorphClause {cons("Morphism")} … … 380 409 PredClause "=" Expr -> MorphClause {cons("Morphism")} 381 410 382 "protect" FunClause "by" Expr -> MorphClause {cons("Protect")} 383 384 "protect" FunClause "by" Expr -> SubClause {cons("Protect")} 385 411 "protect" FunClause "guard" Expr -> Morphism {cons("Protect")} 412 413 "protect" FunClause "guard" Expr -> MorphClause {cons("Protect")} 414 415 "protect" FunClause "guard" Expr -> SubClause {cons("Protect")} 416 417 "protect" FunClause "by" Expr -> Morphism {deprecated("Use 'guard' instead of 'by'"),cons("Protect")} 418 419 "protect" FunClause "by" Expr -> MorphClause {deprecated("Use 'guard' instead of 'by'"),cons("Protect")} 420 421 "protect" FunClause "by" Expr -> SubClause {deprecated("Use 'guard' instead of 'by'"),cons("Protect")} 422 423 %% ImplExpr 424 context-free syntax 425 426 ImplExpr "@" ImplExpr -> ImplExpr {left, cons("At")} 427 ImplExpr "@@" ImplExpr -> ImplExpr {left, cons("AtAt")} 428 ImplExpr "*" ImplExpr -> ImplExpr {left, cons("Star")} 429 ImplExpr "**" ImplExpr -> ImplExpr {left, cons("StarStar")} 430 ImplExpr "+" ImplExpr -> ImplExpr {left, cons("Plus")} 431 ImplExpr "++" ImplExpr -> ImplExpr {left, cons("PlusPlus")} 432 ImplExpr "times" ImplExpr -> ImplExpr {left, cons("Times")} 433 "(" ImplExpr ")" -> ImplExpr {bracket} 434 435 ConceptExpr "@" ConceptExpr -> ConceptExpr {left, cons("At")} 436 ConceptExpr "@@" ConceptExpr -> ConceptExpr {left, cons("AtAt")} 437 ConceptExpr "*" ConceptExpr -> ConceptExpr {left, cons("Star")} 438 ConceptExpr "**" ConceptExpr -> ConceptExpr {left, cons("StarStar")} 439 ConceptExpr "+" ConceptExpr -> ConceptExpr {left, cons("Plus")} 440 ConceptExpr "++" ConceptExpr -> ConceptExpr {left, cons("PlusPlus")} 441 ConceptExpr "times" ConceptExpr -> ConceptExpr {left, cons("Times")} 442 "(" ConceptExpr ")" -> ConceptExpr {bracket} 443 -
trunk/metaxa/src/Magnolia/Core/Expressions.sdf
r425 r458 69 69 %%% Value Construction 70 70 71 Type "$" "{" {InitSpec ","}* "}" -> Expr {cons("Struct"), selectable} 71 Type "$" "{" {InitSpec ","}* "}" -> Expr {cons("Struct"), selectable, todo("With or without '$'?")} 72 73 Type "{" {InitSpec ","}* "}" -> Expr {cons("Struct"), selectable, todo("With or without '$'?")} 72 74 73 75 Identifier ":=" Expr -> InitSpec {cons("Field")} -
trunk/metaxa/src/Magnolia/Core/Identifiers.sdf
r425 r458 36 36 lexical syntax 37 37 38 [A-Za-z][A-Za-z\_\$ 0-9]* -> ID38 [A-Za-z][A-Za-z\_\$\#0-9]* -> ID 39 39 40 40 "_" -> NOID -
trunk/metaxa/src/Magnolia/CoreMix.sdf
r450 r458 3 3 [ MorphClause => MorphClause[[Ctx0]] 4 4 Morphism => Morphism[[Ctx0]] 5 ImplExpr => ImplExpr[[Ctx0]]6 5 ConceptExpr => ConceptExpr[[Ctx0]] 7 6 WithClause => WithClause[[Ctx0]] 8 7 GuardClause => GuardClause[[Ctx0]] 9 8 Attribute => Attribute[[Ctx0]] 10 SubClause => SubClause[[Ctx0]]11 9 AttrClause => AttrClause[[Ctx0]] 12 10 DeclDeclarative => DeclDeclarative[[Ctx0]] 13 DeclName => DeclName[[Ctx0]]14 11 DeclClause => DeclClause[[Ctx0]] 12 TypeIdentifier => TypeIdentifier[[Ctx0]] 13 TypeName => TypeName[[Ctx0]] 15 14 TypeDeclarative => TypeDeclarative[[Ctx0]] 16 TypeName => TypeName[[Ctx0]]17 15 TypeClause => TypeClause[[Ctx0]] 18 16 VarName => VarName[[Ctx0]] 17 VarIdentifier => VarIdentifier[[Ctx0]] 19 18 VarClause => VarClause[[Ctx0]] 20 19 ParamMode => ParamMode[[Ctx0]] 21 20 ProcedureParam => ProcedureParam[[Ctx0]] 22 21 FunctionParam => FunctionParam[[Ctx0]] 23 TypeParam => TypeParam[[Ctx0]]24 22 ProcedureParamList => ProcedureParamList[[Ctx0]] 25 23 FunctionParamList => FunctionParamList[[Ctx0]] 26 TypeParamList => TypeParamList[[Ctx0]]24 AxiomIdentifier => AxiomIdentifier[[Ctx0]] 27 25 AxiomName => AxiomName[[Ctx0]] 28 26 AxiomClause => AxiomClause[[Ctx0]] 29 PredName => PredName[[Ctx0]]30 27 PredClause => PredClause[[Ctx0]] 28 FunIdentifier => FunIdentifier[[Ctx0]] 31 29 ExprDeclarative => ExprDeclarative[[Ctx0]] 32 30 FunClause => FunClause[[Ctx0]] 31 ProcIdentifier => ProcIdentifier[[Ctx0]] 33 32 StatDeclarative => StatDeclarative[[Ctx0]] 34 33 ProcClause => ProcClause[[Ctx0]] 34 SubClause => SubClause[[Ctx0]] 35 35 DeclBody => DeclBody[[Ctx0]] 36 36 Decl => Decl[[Ctx0]] … … 66 66 ModuleHead => ModuleHead[[Ctx0]] 67 67 Program => Program[[Ctx0]] 68 Type => Type[[Ctx0]] ] 68 Type => Type[[Ctx0]] 69 ImplExpr => ImplExpr[[Ctx0]] ] -
trunk/metaxa/src/gen-tbl
r445 r458 1 if [ -d /home/anya/eclipse/ ]; then 2 ECLIPSE=/home/anya/eclipse 3 elif [ -d /usr/local/eclipse/ ]; then 4 ECLIPSE=/usr/local/eclipse 1 #! /bin/sh 2 FRAGMENT=plugins/rascal_fragment_linux_0.1.6 3 4 if [ -d $HOME/eclipse/$FRAGMENT ]; then 5 FRAGMENT=$HOME/eclipse/$FRAGMENT 6 elif [ -d $HOME/magnolia/eclipse/$FRAGMENT ]; then 7 FRAGMENT=$HOME/magnolia/eclipse/$FRAGMENT 8 elif [ -d /usr/local/eclipse/$FRAGMENT ]; then 9 FRAGMENT=/usr/local/eclipse/$FRAGMENT 10 else 11 echo Unable to find rascal-fragment 12 exit 1 5 13 fi 6 14 7 FRAGMENT=$ECLIPSE/plugins/rascal_fragment_linux_0.1.68 15 9 16 export LD_LIBRARY_PATH=$FRAGMENT/installed/lib/
Note:
See TracChangeset
for help on using the changeset viewer.