@Test public void inherit_description_select_override() { DmdlSemantics env = resolve(new String[] { "projective p0 = {", " 'P0'", " r : {INT} = {};", "};", "projective p1 = {", " a : INT;", " 'P1'", " r = {a};", "};", "simple = p0 + p1 + {", " 'SIMPLE'", " r = p1.r;", "};", }); ModelDeclaration model = env.findModelDeclaration("simple"); PropertyReferenceDeclaration r = model.findPropertyReferenceDeclaration("r"); assertThat(r.getDescription(), is(notNullValue())); assertThat(r.getDescription().getText(), is("SIMPLE")); }
static void resolve(Context context, ModelDeclaration model, AstExpression<AstRecord> node) { PropertyReferenceDeclarationProcessor resolver = new PropertyReferenceDeclarationProcessor(context); node.accept(model, resolver); }
PropertyReferenceDeclarationProcessor extends AbstractVisitor<ModelDeclaration, Void> { static void resolve(Context context, ModelDeclaration model, AstExpression<AstRecord> node) { PropertyReferenceDeclarationProcessor resolver = new PropertyReferenceDeclarationProcessor(context); node.accept(model, resolver); } }
PropertyReferenceDeclarationProcessor extends AbstractVisitor<ModelDeclaration, Void> { static void resolve(Context context, ModelDeclaration model, AstExpression<AstRecord> node) { PropertyReferenceDeclarationProcessor resolver = new PropertyReferenceDeclarationProcessor(context); node.accept(model, resolver); } private  PropertyReferenceDeclarationProcessor(Context context); }
PropertyReferenceDeclarationProcessor extends AbstractVisitor<ModelDeclaration, Void> { static void resolve(Context context, ModelDeclaration model, AstExpression<AstRecord> node) { PropertyReferenceDeclarationProcessor resolver = new PropertyReferenceDeclarationProcessor(context); node.accept(model, resolver); } private  PropertyReferenceDeclarationProcessor(Context context); @Override Void visitUnionExpression(ModelDeclaration model, AstUnionExpression<T> node); @Override Void visitRecordDefinition(ModelDeclaration model, AstRecordDefinition node); @Override Void visitModelReference(ModelDeclaration model, AstModelReference node); }
PropertyReferenceDeclarationProcessor extends AbstractVisitor<ModelDeclaration, Void> { static void resolve(Context context, ModelDeclaration model, AstExpression<AstRecord> node) { PropertyReferenceDeclarationProcessor resolver = new PropertyReferenceDeclarationProcessor(context); node.accept(model, resolver); } private  PropertyReferenceDeclarationProcessor(Context context); @Override Void visitUnionExpression(ModelDeclaration model, AstUnionExpression<T> node); @Override Void visitRecordDefinition(ModelDeclaration model, AstRecordDefinition node); @Override Void visitModelReference(ModelDeclaration model, AstModelReference node);  }