Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
onSubprototype_afti_dsa_afsa
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 afti_codeToAdd {
// interpreted Cyan code
}
According to the method name, the Cyan code is interpreted in phase
afti or dsa. Methods of interfaces
IAction_dsa
IActionNewPrototypes_dsa
IAction_afti
IActionNewPrototypes_afti
IParseWithCyanCompiler_dpa
ICommunicateInPrototype_afti_dsa_afsa
IActionMethodMissing_dsa
ICheckSubprototype_afsa
IActionMethodMissing_dsa
can be implemented. To better understand this, see the documentation
for action_afti_dsa.
*}
@onSubprototype_afti_dsa_afsa{*
/* issue a warning message if this prototype is being inherited
by a prototype of another package
*/
func afsa_checkSubprototype {
let WrEnv env = compiler getEnv;
let WrProgramUnit attachedProgramUnit =
metaobject getAttachedDeclaration;
if attachedProgramUnit getPackageName: env != subPrototype getPackageName: env {
Out println:
"Prototype " ++ attachedProgramUnit getFullName ++
" can only be inherited in its own package. It is " ++
"being inherited by " ++ subPrototype getFullName;
}
}
*}
open
object OnSubprototype_afti_dsa_afsa
func run {
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.