Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(802)

Unified Diff: compiler/java/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java

Issue 9479013: Remove backends. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More clean up Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java
diff --git a/compiler/java/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java b/compiler/java/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java
deleted file mode 100644
index 2b854d8313e9a2c042a46367632d16c2dde7faae..0000000000000000000000000000000000000000
--- a/compiler/java/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-package com.google.dart.compiler.backend.js.ast;
-
-/**
- * A JavaScript unary operator.
- */
-public enum JsUnaryOperator implements JsOperator {
-
- /*
- * Precedence indices from "JavaScript - The Definitive Guide" 4th Edition
- * (page 57)
- */
- BIT_NOT("~", 14, PREFIX), DEC("--", 14, POSTFIX | PREFIX), DELETE("delete", 14, PREFIX), INC(
- "++", 14, POSTFIX | PREFIX), NEG("-", 14, PREFIX), POS("+", 14, PREFIX),
- NOT("!", 14, PREFIX), TYPEOF("typeof", 14, PREFIX), VOID("void", 14, PREFIX);
-
- private final int mask;
- private final int precedence;
- private final String symbol;
-
- private JsUnaryOperator(String symbol, int precedence, int mask) {
- this.symbol = symbol;
- this.precedence = precedence;
- this.mask = mask;
- }
-
- @Override
- public int getPrecedence() {
- return precedence;
- }
-
- @Override
- public String getSymbol() {
- return symbol;
- }
-
- @Override
- public boolean isKeyword() {
- return this == DELETE || this == TYPEOF || this == VOID;
- }
-
- @Override
- public boolean isLeftAssociative() {
- return (mask & LEFT) != 0;
- }
-
- public boolean isModifying() {
- return this == DEC || this == INC || this == DELETE;
- }
-
- @Override
- public boolean isPrecedenceLessThan(JsOperator other) {
- return precedence < other.getPrecedence();
- }
-
- @Override
- public boolean isValidInfix() {
- return (mask & INFIX) != 0;
- }
-
- @Override
- public boolean isValidPostfix() {
- return (mask & POSTFIX) != 0;
- }
-
- @Override
- public boolean isValidPrefix() {
- return (mask & PREFIX) != 0;
- }
-
- @Override
- public String toString() {
- return symbol;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698