Next: Examples of gnatxref Usage, Previous: Project Files for gnatxref and gnatfind, Up: The Cross-Referencing Tools gnatxref and gnatfind
gnatfind and gnatxrefAs specified in the section about gnatfind, the pattern can be a regular expression. Actually, there are to set of regular expressions which are recognized by the program:
globbing patternsHere is a more formal grammar:
          regexp ::= term
          term   ::= elmt            -- matches elmt
          term   ::= elmt elmt       -- concatenation (elmt then elmt)
          term   ::= *               -- any string of 0 or more characters
          term   ::= ?               -- matches any character
          term   ::= [char {char}]   -- matches any character listed
          term   ::= [char - char]   -- matches any character in range
     
     full regular expressionThe following is the form of a regular expression, expressed in Ada reference manual style BNF is as follows
          regexp ::= term {| term}   -- alternation (term or term ...)
          
          term ::= item {item}       -- concatenation (item then item)
          
          item ::= elmt              -- match elmt
          item ::= elmt *            -- zero or more elmt's
          item ::= elmt +            -- one or more elmt's
          item ::= elmt ?            -- matches elmt or nothing
          elmt ::= nschar            -- matches given character
          elmt ::= [nschar {nschar}]   -- matches any character listed
          elmt ::= [^ nschar {nschar}] -- matches any character not listed
          elmt ::= [char - char]     -- matches chars in given range
          elmt ::= \ char            -- matches given character
          elmt ::= .                 -- matches any single character
          elmt ::= ( regexp )        -- parens used for grouping
          
          char ::= any character, including special characters
          nschar ::= any character except ()[].*+?^
     
     Following are a few examples: