Leaked source code of windows server 2003
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.

75 lines
2.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Provider SQL Level 1 Syntax (LL1)
  4. //
  5. // 21-Jun-96 Created
  6. // 01-Jul-96 Instrinsic functions on constants
  7. //
  8. // Simple SQL subset for unary queries to be implemented within individual
  9. // providers.
  10. //
  11. /////////////////////////////////////////////////////////////////////////////
  12. <parse> ::= SELECT <prop_list> FROM <class_name> <opt_where>;
  13. <opt_where> ::= WHERE <expr>;
  14. <opt_where> ::= <>;
  15. <prop_list> ::= <property_name> <prop_list_2>;
  16. <prop_list_2> ::= COMMA <prop_list>;
  17. <prop_list_2> ::= <>;
  18. <property_name> ::= IDENTIFIER;
  19. <property_name> ::= ASTERISK;
  20. <class_name> ::= IDENTIFIER;
  21. // Subexpression nesting. This particular sequence gives
  22. // a series of AND clauses precedence over OR clauses.
  23. <expr> ::= <term> <expr2>;
  24. <expr2> ::= OR <term> <expr2>;
  25. <expr2> ::= <>;
  26. <term> ::= <simple_expr> <term2>;
  27. <term2> ::= AND <simple_expr> <term2>;
  28. <term2> ::= <>;
  29. // Simple expression types.
  30. // ========================
  31. <simple_expr> ::= NOT <expr>;
  32. <simple_expr> ::= OPEN_PAREN <expr> CLOSE_PAREN;
  33. <simple_expr> ::= IDENTIFIER <leading_ident_expr> <finalize>;
  34. <simple_expr> ::= VARIANT <rel_operator> <trailing_prop_expr> <finalize>;
  35. <trailing_prop_expr> ::= IDENTIFIER <trailing_prop_expr2>;
  36. <trailing_prop_expr2> ::= OPEN_PAREN IDENTIFIER CLOSE_PAREN;
  37. <trailing_prop_expr2> ::= <>;
  38. <leading_ident_expr> ::= OPEN_PAREN <unknown_func_expr>;
  39. <leading_ident_expr> ::= <comp_operator> <trailing_const_expr>;
  40. <leading_ident_expr> ::= <equiv_operator> <trailing_or_null>;
  41. <leading_ident_expr> ::= <is_operator> NULL;
  42. <unknown_func_expr> ::= IDENTIFIER CLOSE_PAREN <rel_operator> <trailing_const_expr>;
  43. <unknown_func_expr> ::= <typed_constant> CLOSE_PAREN <rel_operator> <trailing_prop_expr>;
  44. <trailing_or_null> ::= NULL;
  45. <trailing_or_null> ::= <trailing_const_expr>;
  46. <trailing_or_null> ::= <trailing_prop_expr>;
  47. <trailing_const_expr> ::= <typed_constant>;
  48. <trailing_const_expr> ::= IDENTIFIER OPEN_PAREN <typed_constant> CLOSE_PAREN;
  49. <typed_constant> ::= VARIANT; // VT_R8, VT_I4, VT_BSTR
  50. <finalize> ::= <>;
  51. // This is just a semantic production in the parser to allow
  52. // all the important code to be located in one place.
  53. <rel_operator> ::= <equiv_operator>;
  54. <rel_operator> ::= <comp_operator>;
  55. <equiv_operator> ::= EQUIVALENT_OPERATOR; // =, !=
  56. <comp_operator> ::= COMPARE_OPERATOR; // <=, >=, <, >, like
  57. <is_operator> ::= ISNOT_OPERATOR; // IS, IS NOT