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

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


    if (token.getChildCount() == 1)
      return (SupportsCondition) switchOn(children.next());

    SupportsLogicalCondition result = new SupportsLogicalCondition(token, (SupportsCondition) switchOn(children.next()));
    while (children.hasNext()) {
      SupportsLogicalOperator logicalOperator = toSupportsLogicalOperator(children.next());
      if (!children.hasNext())
        throw new BugHappened(GRAMMAR_MISMATCH, token);
      SupportsCondition condition = (SupportsCondition) switchOn(children.next());
      result.addCondition(logicalOperator, condition);
    }
View Full Code Here


  private SupportsLogicalOperator toSupportsLogicalOperator(HiddenTokenAwareTree token) {
    String text = token.getText();
    Map<String, Operator> operatorsBySymbol = SupportsLogicalOperator.Operator.getSymbolsMap();
    if (text == null || !operatorsBySymbol.containsKey(text.toLowerCase())) {
      SupportsLogicalOperator result = new SupportsLogicalOperator(token, null);
      problemsHandler.errWrongSupportsLogicalOperator(result, token.getText());
      return result;
    }

    SupportsLogicalOperator result = new SupportsLogicalOperator(token, operatorsBySymbol.get(text.toLowerCase()));
    return result;
  }
View Full Code Here

  private void checkForLogicalConditionConsistency(SupportsLogicalCondition condition) {
    Iterator<SupportsLogicalOperator> logicalOperators = condition.getLogicalOperators().iterator();
    if (!logicalOperators.hasNext())
      return;

    SupportsLogicalOperator masterOperator = logicalOperators.next();
    while (logicalOperators.hasNext()) {
      SupportsLogicalOperator operator = logicalOperators.next();
      if (!masterOperator.getOperator().equals(operator.getOperator()))
        problemsHandler.warnInconsistentSupportsLogicalConditionOperators(operator, masterOperator);
    }
  }
View Full Code Here

TOP

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

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.