A work-in-progress SQL parser written in TypeScript
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

binary.ts 579B

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