Package com.github.sommeri.less4j.core.ast

Examples of com.github.sommeri.less4j.core.ast.BinaryExpressionOperator


  private Expression createBinaryExpression(HiddenTokenAwareTree parent, LinkedList<HiddenTokenAwareTree> members) {
    // this must represent a term. Otherwise we are doomed anyway.
    Expression head = (Expression) switchOn(members.removeFirst());
    while (!members.isEmpty()) {
      BinaryExpressionOperator operator = createBinaryOperator(members.removeFirst());
      if (members.isEmpty())
        return new BinaryExpression(parent, head, operator, null);

      Expression next = (Expression) switchOn(members.removeFirst());
      head = new BinaryExpression(parent, head, operator, next);
View Full Code Here


    }
    return head;
  }

  public BinaryExpressionOperator createBinaryOperator(HiddenTokenAwareTree token) {
    BinaryExpressionOperator operator = new BinaryExpressionOperator(token, toExpressionOperator(token));
    return operator;
  }
View Full Code Here

  public Expression evalute(BinaryExpression originalExpression, Expression firstNumber, Expression secondNumber) {
    NumberExpression first = (NumberExpression) firstNumber;
    NumberExpression second = (NumberExpression) secondNumber;

    BinaryExpressionOperator operator = originalExpression.getOperator();
    switch (operator.getOperator()) {
    case SOLIDUS:
      return divide(first, second, originalExpression);
    case STAR:
      return multiply(first, second, originalExpression);
    case MINUS:
View Full Code Here

    double red2 = calcRed(second);
    double green2 = calcGreen(second);
    double blue2 = calcBlue(second);
    double alpha2 = calcAlpha(second);

    BinaryExpressionOperator operator = originalExpression.getOperator();
    switch (operator.getOperator()) {
    case SOLIDUS:
      return divide(first, red1, green1, blue1, alpha1,  red2, green2, blue2, alpha2, originalExpression.getUnderlyingStructure());
    case STAR:
      return multiply(red1, green1, blue1, alpha1, red2, green2, blue2, alpha2, originalExpression.getUnderlyingStructure());
    case MINUS:
View Full Code Here

TOP

Related Classes of com.github.sommeri.less4j.core.ast.BinaryExpressionOperator

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.