Advertisement
Guest User

Untitled

a guest
Jun 7th, 2017
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export class LogicOr extends AbstractLogicExpression {
  2.  
  3.   protected rightAssociative = false;
  4.   protected _precedence = 1;
  5.   protected _expressionType = "+";
  6.  
  7.   phraseToString(): string {
  8.     let result: string = "(";
  9.     for(let expression of this.logicChildExpressions) {
  10.       result += expression.phraseToString() +  "+";
  11.     }
  12.     result = result.substring(0, result.length - 1);
  13.     result += ")";
  14.  
  15.     return result;
  16.   }
  17.  
  18.   public toString(): string {
  19.     return "+";
  20.   }
  21.  
  22.   public getResult(): boolean {
  23.     let result: boolean = true;
  24.     for(let expression of this.logicChildExpressions) {
  25.       result = result || expression.getResult();
  26.     }
  27.     return result;
  28.   }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement