A work-in-progress SQL parser written in TypeScript
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

binary.ts 594B

123456789101112131415161718192021222324252627282930
  1. import * as AST from "../ast";
  2. export enum BinaryExpressionTypes {
  3. ADDITION = "ADDITION",
  4. AND = "AND",
  5. DIVISION = "DIVISION",
  6. DOT = "DOT",
  7. EQUALITY = "EQUALITY",
  8. MULTIPLICATION = "MULTIPLICATION",
  9. OR = "OR",
  10. SUBTRACTION = "SUBTRACTION",
  11. }
  12. interface IBinaryOptions {
  13. type: BinaryExpressionTypes;
  14. left: AST.Expr;
  15. right: AST.Expr;
  16. }
  17. export class Binary {
  18. public type: BinaryExpressionTypes;
  19. public left: AST.Expr;
  20. public right: AST.Expr;
  21. constructor(opts: IBinaryOptions) {
  22. this.type = opts.type;
  23. this.left = opts.left;
  24. this.right = opts.right;
  25. }
  26. }