A work-in-progress SQL parser written in TypeScript
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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 | AST.Star;
  16. }
  17. export class Binary {
  18. public type: BinaryExpressionTypes;
  19. public left: AST.Expr;
  20. public right: AST.Expr | AST.Star;
  21. constructor(opts: IBinaryOptions) {
  22. this.type = opts.type;
  23. this.left = opts.left;
  24. this.right = opts.right;
  25. }
  26. }