Package com.asakusafw.dmdl.semantics

Examples of com.asakusafw.dmdl.semantics.PropertySymbol


        Map<String, PropertySymbol> reverseMapping = Maps.create();
        for (MappingFactor mapping : term.getMappings()) {
            reverseMapping.put(mapping.getTarget().getName().identifier, mapping.getSource());
        }
        for (PropertySymbol property : term.getGrouping()) {
            PropertySymbol origin = reverseMapping.get(property.getName().identifier);
            assert origin != null;
            PropertyDeclaration decl = origin.findDeclaration();
            properties.add(Models.toLiteral(f, context.getFieldName(decl).getToken()));
        }
        return new AttributeBuilder(f)
            .annotation(context.resolve(Key.class),
                    "group", f.newArrayInitializer(properties)) //$NON-NLS-1$
View Full Code Here


        Map<String, PropertySymbol> reverseMapping = Maps.create();
        for (MappingFactor mapping : term.getMappings()) {
            reverseMapping.put(mapping.getTarget().getName().identifier, mapping.getSource());
        }
        for (PropertySymbol property : term.getGrouping()) {
            PropertySymbol origin = reverseMapping.get(property.getName().identifier);
            assert origin != null;
            PropertyDeclaration decl = origin.findDeclaration();
            properties.add(Models.toLiteral(f, context.getFieldName(decl).getToken()));
        }
        return new AttributeBuilder(f)
            .annotation(context.resolve(Key.class),
                    "group", f.newArrayInitializer(properties)) //$NON-NLS-1$
View Full Code Here

    protected Matcher<PropertySymbol> property(final String modelName, final String name) {
        return new BaseMatcher<PropertySymbol>() {
            @Override
            public boolean matches(Object object) {
                if (object instanceof PropertySymbol) {
                    PropertySymbol property = (PropertySymbol) object;
                    return property.getName().identifier.equals(name)
                        && property.getOwner().getName().identifier.equals(modelName);
                }
                return false;
            }
            @Override
            public void describeTo(Description desc) {
View Full Code Here

                        "{0}.{1} must be a simple property name of array",
                        TARGET_NAME,
                        ELEMENT_NAME));
                continue;
            }
            PropertySymbol property = declaration.createPropertySymbol((AstSimpleName) value);
            if (property.findDeclaration() == null) {
                environment.report(new Diagnostic(
                        Level.ERROR,
                        value,
                        "{0} is not declared in {1}",
                        value,
View Full Code Here

            return;
        }

        Holder holder = new Holder(environment, declaration, attribute);

        PropertySymbol sid = holder.takeProperty(SID_ELEMENT_NAME);
        PropertySymbol timestamp = holder.takeProperty(TIMESTAMP_ELEMENT_NAME);
        PropertySymbol delete = holder.takeProperty(DELETE_FLAG_ELEMENT_NAME);
        AstLiteral deleteValue = holder.takeLiteral(DELETE_FLAG_VALUE_ELEMENT_NAME);
        holder.checkEmpty();
        if (holder.sawError) {
            return;
        }
View Full Code Here

                        TARGET_NAME,
                        elementName);
                return null;
            }
            AstSimpleName value = (AstSimpleName) nameElement.value;
            PropertySymbol property = model.createPropertySymbol(value);
            if (property.findDeclaration() == null) {
                error(
                        value,
                        "{0} is not declared in {1}",
                        value,
                        model.getName());
View Full Code Here

            Set<String> groupingProperties = Sets.create();
            for (PropertySymbol grouping : term.getGrouping()) {
                groupingProperties.add(grouping.getName().identifier);
            }
            for (MappingFactor factor : term.getMappings()) {
                PropertySymbol target = factor.getTarget();
                Type declared = typeMap.get(target.getName().identifier);
                if (declared == null) {
                    typeMap.put(target.getName().identifier, target.findDeclaration().getType());
                } else if (groupingProperties.contains(target.getName().identifier) == false) {
                    report(new Diagnostic(
                            Level.ERROR,
                            term.getOriginalAst(),
                            Messages.getString("DmdlAnalyzer.diagnosticDuplicatedJoinGroupingProperty"), //$NON-NLS-1$
                            target.getName().identifier));
                    green = false;
                }
            }
        }
        return green;
View Full Code Here

            assert firstSources.size() == nextSources.size();
            for (int i = 0, n = firstSources.size(); i < n; i++) {
                PropertyDeclaration left = firstSources.get(i);
                PropertyDeclaration right = nextSources.get(i);
                if (left.getType().isSame(right.getType()) == false) {
                    PropertySymbol rightSymbol = next.getGrouping().get(i);
                    report(new Diagnostic(
                            Level.ERROR,
                            rightSymbol.getOriginalAst(),
                            Messages.getString("DmdlAnalyzer.diagnosticInconsistentTypeGroupingProperty"), //$NON-NLS-1$
                            rightSymbol.getName()));
                    green = false;
                }
            }
        }
        return green;
View Full Code Here

        for (MappingFactor entry : term.getMappings()) {
            rmap.put(entry.getTarget(), entry.getSource());
        }
        List<PropertyDeclaration> results = new ArrayList<PropertyDeclaration>();
        for (PropertySymbol prop : term.getGrouping()) {
            PropertySymbol source = rmap.get(prop);
            if (source == null) {
                source = prop;
            }
            results.add(source.findDeclaration());
        }
        return results;
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.dmdl.semantics.PropertySymbol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.