Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joseoliv/f9f45d38d7a96c99d7a63b8f3a1ceeee to your computer and use it in GitHub Desktop.
Save joseoliv/f9f45d38d7a96c99d7a63b8f3a1ceeee to your computer and use it in GitHub Desktop.
onSubprototype_afterResTypes_semAn_afterSemAn
package metaobjectTest
@doc{*
Annotations of this metaobject should be attached to a prototype.
The attached DSL code is made in Myan, which supports interpreted Cyan
within parameterless methods declared with 'func':
func afterResTypes_codeToAdd {
// interpreted Cyan code
}
According to the method name, the Cyan code is interpreted in phase
afterResTypes or semAn. Methods of interfaces
IAction_semAn
IActionNewPrototypes_semAn
IAction_afterResTypes
IActionNewPrototypes_afterResTypes
IParseWithCyanCompiler_dpa
ICommunicateInPrototype_afterResTypes_semAn_afterSemAn
IActionMethodMissing_semAn
ICheckSubprototype_afterSemAn
IActionMethodMissing_semAn
can be implemented. To better understand this, see the documentation
for action_afterResTypes_semAn.
*}
@onSubprototype_afterResTypes_semAn_afterSemAn{*
/* issue a warning message if this prototype is being inherited
by a prototype of another package
*/
func afterSemAn_checkSubprototype {
let WrEnv env = compiler getEnv;
let WrPrototype attachedPrototype =
metaobject getAttachedDeclaration;
if attachedPrototype getPackageName != subPrototype getPackageName {
Out println:
"Prototype " ++ attachedPrototype getFullName ++
" can only be inherited in its own package. It is " ++
"being inherited by " ++ subPrototype getFullName;
}
}
*}
open
object OnSubprototype_afterResTypes_semAn_afterSemAn
func run {
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment