< prev index next >
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/TokenType.java
Print this page
rev 1309 : 8085885: address Javadoc warnings in Nashorn source code
*** 1,7 ****
/*
! * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 220,251 ****
this.isLeftAssociative = isLeftAssociative;
}
/**
* Determines if the token has greater precedence than other.
* @param other Compare token.
* @param isLeft Is to the left of the other.
! * @return True if greater precedence.
*/
public boolean needsParens(final TokenType other, final boolean isLeft) {
return other.precedence != 0 &&
(precedence > other.precedence ||
precedence == other.precedence && isLeftAssociative && !isLeft);
}
/**
* Determines if the type is a valid operator.
! * @param noIn TRUE if IN operator should be ignored.
! * @return TRUE if valid operator.
*/
public boolean isOperator(final boolean noIn) {
return kind == BINARY && (!noIn || this != IN) && precedence != 0;
}
! /**
! * Accessors.
! */
public int getLength() {
assert name != null : "Token name not set";
return name.length();
}
--- 220,253 ----
this.isLeftAssociative = isLeftAssociative;
}
/**
* Determines if the token has greater precedence than other.
+ *
* @param other Compare token.
* @param isLeft Is to the left of the other.
! *
! * @return {@code true} if greater precedence.
*/
public boolean needsParens(final TokenType other, final boolean isLeft) {
return other.precedence != 0 &&
(precedence > other.precedence ||
precedence == other.precedence && isLeftAssociative && !isLeft);
}
/**
* Determines if the type is a valid operator.
! *
! * @param noIn {@code true} if IN operator should be ignored.
! *
! * @return {@code true} if valid operator.
*/
public boolean isOperator(final boolean noIn) {
return kind == BINARY && (!noIn || this != IN) && precedence != 0;
}
!
public int getLength() {
assert name != null : "Token name not set";
return name.length();
}
< prev index next >