diff options
author | Matthew Bastien | 2015-12-14 16:12:50 +0000 |
---|---|---|
committer | Matthew Bastien | 2015-12-14 16:13:52 +0000 |
commit | 84b5f4bfd2ec9c1b7f317f8013360f20ccb0eee0 (patch) | |
tree | 9448c3d6375ced7a45892612ad45946b285568cd /qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/qmljs/IJSBinaryExpression.java | |
parent | e62e2772fe26628dbdc0cf86675983f7c399e7aa (diff) | |
download | org.eclipse.cdt-84b5f4bfd2ec9c1b7f317f8013360f20ccb0eee0.tar.gz org.eclipse.cdt-84b5f4bfd2ec9c1b7f317f8013360f20ccb0eee0.tar.xz org.eclipse.cdt-84b5f4bfd2ec9c1b7f317f8013360f20ccb0eee0.zip |
Bug 480238 - QML AST in Java
Created a set of Interfaces to represent the JavaScript and QML Ast in
plain Java. Updated acorn-qml to be able to parse the entirety of QML
syntax as specified by the QML grammar. Also modified the QML AST to
represent the added syntax and modified tern-qml to handle the new AST
elements.
Changed the way that the QMLAnalyzer handles path resolution. Paths are
now relative to the local file system.
Note: the normal acorn-qml parser cannot parse the full range of QML
syntax due to ambiguities. However, the loose parser can. We're still
waiting on Acorn to bring lookahead to the normal parser in order to
resolve this.
Change-Id: I77c820ad46301975b2a91969a656d428ad9409c1
Signed-off-by: Matthew Bastien <mbastien@blackberry.com>
Diffstat (limited to 'qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/qmljs/IJSBinaryExpression.java')
-rw-r--r-- | qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/qmljs/IJSBinaryExpression.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/qmljs/IJSBinaryExpression.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/qmljs/IJSBinaryExpression.java new file mode 100644 index 00000000000..43790d77d59 --- /dev/null +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/qmljs/IJSBinaryExpression.java @@ -0,0 +1,65 @@ +/*******************************************************************************
+ * Copyright (c) 2015 QNX Software Systems and others.
+ * 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:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.qt.core.qmljs;
+
+/**
+ * A JavaScript binary expression from the <a href="https://github.com/estree/estree/blob/master/spec.md#binaryexpression">ESTree
+ * Specification</a>
+ */
+public interface IJSBinaryExpression extends IJSExpression {
+ /**
+ * An Enumeration covering the 21 binary operators in JavaScript
+ */
+ enum BinaryOperator {
+ Equality("=="), //$NON-NLS-1$
+ Inequality("!="), //$NON-NLS-1$
+ StrictEquality("==="), //$NON-NLS-1$
+ LessThan("<"), //$NON-NLS-1$
+ LessThanOrEqual("<="), //$NON-NLS-1$
+ GreaterThan(">"), //$NON-NLS-1$
+ GreaterThanOrEqual(">="), //$NON-NLS-1$
+ LeftShift("<<"), //$NON-NLS-1$
+ RightShift(">>"), //$NON-NLS-1$
+ UnsignedRightShift(">>>"), //$NON-NLS-1$
+ Add("+"), //$NON-NLS-1$
+ Subtract("-"), //$NON-NLS-1$
+ Multiply("*"), //$NON-NLS-1$
+ Divide("/"), //$NON-NLS-1$
+ Modulus("%"), //$NON-NLS-1$
+ Or("|"), //$NON-NLS-1$
+ EclusiveOr("^"), //$NON-NLS-1$
+ And("&"), //$NON-NLS-1$
+ In("in"), //$NON-NLS-1$
+ Instanceof("instanceof"); //$NON-NLS-1$
+
+ private final String op;
+
+ private BinaryOperator(String op) {
+ this.op = op;
+ }
+
+ @Override
+ public String toString() {
+ return this.op;
+ }
+ }
+
+ @Override
+ default String getType() {
+ return "UnaryExpression"; //$NON-NLS-1$
+ }
+
+ public BinaryOperator getOperator();
+
+ public IJSExpression getLeft();
+
+ public IJSExpression getRight();
+}
|