logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

PatternGrammar.txt (793B)


  1. # Copyright 2006 Google, Inc. All Rights Reserved.
  2. # Licensed to PSF under a Contributor Agreement.
  3. # A grammar to describe tree matching patterns.
  4. # Not shown here:
  5. # - 'TOKEN' stands for any token (leaf node)
  6. # - 'any' stands for any node (leaf or interior)
  7. # With 'any' we can still specify the sub-structure.
  8. # The start symbol is 'Matcher'.
  9. Matcher: Alternatives ENDMARKER
  10. Alternatives: Alternative ('|' Alternative)*
  11. Alternative: (Unit | NegatedUnit)+
  12. Unit: [NAME '='] ( STRING [Repeater]
  13. | NAME [Details] [Repeater]
  14. | '(' Alternatives ')' [Repeater]
  15. | '[' Alternatives ']'
  16. )
  17. NegatedUnit: 'not' (STRING | NAME [Details] | '(' Alternatives ')')
  18. Repeater: '*' | '+' | '{' NUMBER [',' NUMBER] '}'
  19. Details: '<' Alternatives '>'