Commit Milestone 3.3 according to CQ 6703
http://dev.eclipse.org/ipzilla/show_bug.cgi?id=6703
diff --git a/org.eclipse.viatra2.loaders.vtcl_lpgparser/src/org/eclipse/viatra2/lpgparser/ast/TypeNameAST3.java b/org.eclipse.viatra2.loaders.vtcl_lpgparser/src/org/eclipse/viatra2/lpgparser/ast/TypeNameAST3.java
new file mode 100644
index 0000000..4fbe2af
--- /dev/null
+++ b/org.eclipse.viatra2.loaders.vtcl_lpgparser/src/org/eclipse/viatra2/lpgparser/ast/TypeNameAST3.java
@@ -0,0 +1,39 @@
+/**
+* Copyright (c) 2007 - 2009 OptXware Research and Development LLC.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* Daniel Varro - Initial API and implementation
+*
+* This file was generated automatically based upon the VTCL LPG Parser
+* VTCLParser.g
+*/
+
+package org.eclipse.viatra2.lpgparser.ast;
+
+import lpg.lpgjavaruntime.*;
+
+/**
+ *<b>
+ *<li>Rule 245: TypeNameAST ::= StringLiteral
+ *</b>
+ */
+public class TypeNameAST3 extends ASTNodeToken implements ITypeNameAST
+{
+ public TypeNameAST3(IToken token) { super(token); initialize(); }
+
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ public void accept(Visitor v) { v.visit(this); }
+ public void accept(ArgumentVisitor v, Object o) { v.visit(this, o); }
+ public Object accept(ResultVisitor v) { return v.visit(this); }
+ public Object accept(ResultArgumentVisitor v, Object o) { return v.visit(this, o); }
+}
+
+
diff --git a/org.eclipse.viatra2.loaders.vtcl_lpgparser/src/org/eclipse/viatra2/lpgparser/modelbuilder/ModelBuilderHelper.java b/org.eclipse.viatra2.loaders.vtcl_lpgparser/src/org/eclipse/viatra2/lpgparser/modelbuilder/ModelBuilderHelper.java
new file mode 100644
index 0000000..8647db9
--- /dev/null
+++ b/org.eclipse.viatra2.loaders.vtcl_lpgparser/src/org/eclipse/viatra2/lpgparser/modelbuilder/ModelBuilderHelper.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2009-2011, Zoltan Ujhelyi and Daniel Varro
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Zoltan Ujhelyi - initial API and implementation
+ *******************************************************************************/
+
+/**
+ *
+ */
+package org.eclipse.viatra2.lpgparser.modelbuilder;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.viatra2.errors.info.Location;
+import org.eclipse.viatra2.gtasm.support.helper.GTASMHelper;
+import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.core.AnnotatedElement;
+import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.core.Annotation;
+
+/**
+ * Helper methods for the model builder and type resolver classes
+ * @author Zoltan Ujhelyi
+ *
+ */
+public class ModelBuilderHelper {
+
+ /**
+ * Returns the annotation of a ModelElement corresponding to a specific
+ * annotation key
+ * @param key
+ * {@link IAnnotationKeys}, typically the location
+ * @param annotations
+ * the list of annotation of the model element
+ * @return annotation the first {@link Annotation} stored at the specific
+ * key
+ */
+ public static Annotation lookupAnnotation(String key, List<Annotation> annotations) {
+ boolean found = false;
+ Annotation annotation = null;
+ // Seek for pattern variable in the symbolic parameters of the pattern
+ // header
+ Iterator<Annotation> iter1 = annotations.iterator();
+ while (!found && iter1.hasNext()) {
+ annotation = iter1.next();
+ // Check if the names are corresponding
+ if (annotation.getKey().equals(key)) {
+ found = true;
+ }
+ }
+ return annotation;
+
+ }
+
+ public static Location createLocationInfo(AnnotatedElement node) {
+ EList<Annotation> annotations = node.getAnnotations();
+ Location location = createLocationInfo(annotations);
+ return location;
+ }
+
+ /**
+ * Calculates the location information from a list of annotations. If no
+ * location annotations are present in the list, it returns a location with
+ * (0,0,0,0) user-readable and (0:0) offset-value.
+ * @param annotations
+ * a non-null list of annotations
+ * @return the created location
+ */
+ public static Location createLocationInfo(List<Annotation> annotations) {
+ // Report reference resolution error
+ Annotation locInfo = ModelBuilderHelper.lookupAnnotation(GTASMHelper.NODE_INFORMATION,
+ annotations);
+ Annotation offsetInfo = ModelBuilderHelper.lookupAnnotation(GTASMHelper.NODE_OFFSET, annotations);
+ // Handle empty annotations
+ String locationStr = (locInfo != null) ? locInfo.getValue()
+ : "0,0,0,0";
+ String offsetStr = (offsetInfo != null) ? offsetInfo.getValue() : "0:0";
+ Location location = new Location(locationStr, offsetStr);
+ return location;
+ }
+}