Example #1
0
 public static boolean static_canBeAChild(
     final IOperationContext operationContext, final CanBeAChildContext _context) {
   if (SNodeOperations.isInstanceOf(
       _context.getParentNode(), "jetbrains.mps.baseLanguage.structure.VariableDeclaration")) {
     SNode variableDeclaration =
         SNodeOperations.cast(
             _context.getParentNode(), "jetbrains.mps.baseLanguage.structure.VariableDeclaration");
     return SNodeOperations.isInstanceOf(
             SLinkOperations.getTarget(variableDeclaration, "type", true),
             "jetbrains.mps.baseLanguage.structure.ArrayType")
         && _context.getLink()
             == SLinkOperations.findLinkDeclaration(
                 "jetbrains.mps.baseLanguage.structure.VariableDeclaration", "initializer");
   }
   if (SNodeOperations.isInstanceOf(
       _context.getParentNode(), "jetbrains.mps.baseLanguage.structure.AnnotationInstanceValue")) {
     return true;
   }
   if (SNodeOperations.isInstanceOf(
       _context.getParentNode(), "jetbrains.mps.baseLanguage.structure.AnnotationInstance")) {
     return true;
   }
   return false;
 }
Example #2
0
 public static boolean static_canBeAChild(
     final IOperationContext operationContext, final CanBeAChildContext _context) {
   return TypeChecker.getInstance()
       .getSubtypingManager()
       .isSubtype(
           TypeChecker.getInstance()
               .getTypeOf(
                   SLinkOperations.getTarget(
                       SNodeOperations.as(
                           _context.getParentNode(),
                           "jetbrains.mps.baseLanguage.structure.DotExpression"),
                       "operand",
                       true)),
           new CallMethodOperation_Constraints.QuotationClass_j1qytb_a1a0a0a().createNode());
 }