// Copyright (c) 2007-2010 by Kavanagh Consultancy Limited. All rights reserved. PatternLanguage : // Syntax Rules ruleSet := identifier ':' { syntaxRule }+ [ identifier "::" { lexicalRule }+ ] syntaxRule := identifier ":=" pattern lexicalRule := identifier ( ":=" | "::=" ) pattern pattern := logicalOrPattern logicalOrPattern := sequentialPattern { '|' sequentialPattern }* sequentialPattern := { logicalAndPattern }+ logicalAndPattern := logicalAndLengthEqualsPattern { "&&" logicalAndLengthEqualsPattern }* logicalAndLengthEqualsPattern := logicalNotPattern { "&&==" logicalNotPattern }* logicalNotPattern := [ '!' ] simplePattern simplePattern := useRulePattern | characterPattern | stringPattern | '(' pattern ')' | conditionalPattern | repeatingPattern | errorMessagePattern useRulePattern := identifier ( '.' identifier | ! ":=" ! "::" ! "::=" ) characterPattern := characterLiteral [ ".." characterLiteral ] stringPattern := stringLiteral conditionalPattern := '[' pattern ']' repeatingPattern := '{' pattern ( "}*" | "}+" ) errorMessagePattern := ">>" stringLiteral PatternLanguage :: // Lexical Rules input := { $javaWhitespace | $javaComment | token }* token := identifier | characterLiteral | stringLiteral | separatorOrOperator identifier ::= $javaIdentifier characterLiteral ::= $javaCharacterLiteral | $javaIntegerLiteral stringLiteral ::= $javaStringLiteral separatorOrOperator ::= "&&==" | "::=" | "&&" | ".." | "::" | ":=" | ">>" | "}*" | "}+" | '!' | '(' | ')' | '.' | ':' | '[' | ']' | '{' | '|' // End of File