A work-in-progress SQL parser written in TypeScript
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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. }