PHP Classes

How to Perform PHP Grammar Check on a String Using Mezon Formal Grammar: Validate a string according to your grammar rules

Recommend this page to a friend!
  Info   View files View files (41)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2022-01-25 (6 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 39 All time: 10,464 This week: 423Up
Version License PHP version Categories
mezon-formal-grammar 1.0.0MIT/X Consortium ...5Algorithms, PHP 5, Text processing, V..., P...
Description Author

This package can validate a string according to your own grammar rules.

It provides classes that can compose a set of text grammar rules.

The package can also validate a given text string according to those rules.

It provides built-in classes that implement several rules to compose a more complex grammar. Currently, it provides classes to:

- Match case sensitive text

- Match text from a given character set

- Match any rule from a set of rules

- Match rules from a complex set of rules

- Match a compound set of rules

- Match an empty string

- Match a set of rules in any order

- Match precisely one character

- Match precisely one character or nothing

- Match one or more characters

- Match one or more characters or nothing

- Etc.

Innovation Award
PHP Programming Innovation award nominee
January 2022
Number 6
Some applications need to parse a text that follows specific grammar rules.

This package allows developers to dynamically create their own grammar rules using classes that implement simple grammar rules.

Then the package can validate a string to check if it complies with the grammar rules defined dynamically.

Manuel Lemos
Picture of Alexey Dodonov
  Performance   Level  
Name: Alexey Dodonov <contact>
Classes: 55 packages by
Country: Russian Federation Russian Federation
Age: ???
All time rank: 194355 in Russian Federation Russian Federation
Week rank: 62 Up6 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 11x

  Files folder image Files  
File Role Description
Files folder imageMezon (2 files, 2 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file infection.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file psalm-self.xml Data Auxiliary data
Accessible without login Plain text file psalm.xml Data Auxiliary data

  Files folder image Files  /  Mezon  
File Role Description
Files folder imageRules (1 file, 2 directories)
Files folder imageTests (2 files, 2 directories)
  Plain text file FormalGrammar.php Class Class source
  Plain text file StringIterator.php Class Class source

  Files folder image Files  /  Mezon  /  Rules  
File Role Description
Files folder imageComplex (4 files)
Files folder imageTerminal (2 directories)
  Plain text file RuleInterface.php Class Class source

  Files folder image Files  /  Mezon  /  Rules  /  Complex  
File Role Description
  Plain text file AnyRuleFromSet.php Class Class source
  Plain text file CompoundRule.php Class Class source
  Plain text file RulesInAnyOrder.php Class Class source
  Plain text file RulesSet.php Class Class source

  Files folder image Files  /  Mezon  /  Rules  /  Terminal  
File Role Description
Files folder imageCharSet (5 files)
Files folder imageLiteral (2 files, 2 directories)

  Files folder image Files  /  Mezon  /  Rules  /  Terminal  /  CharSet  
File Role Description
  Plain text file OneExactly.php Class Class source
  Plain text file OneExactlyOrNothing.php Class Class source
  Plain text file OneOrMore.php Class Class source
  Plain text file OneOrMoreBase.php Class Class source
  Plain text file OneOrMoreOrNothing.php Class Class source

  Files folder image Files  /  Mezon  /  Rules  /  Terminal  /  Literal  
File Role Description
Files folder imageCaseInSensitive (3 files)
Files folder imageCaseSensitive (3 files)
  Plain text file EmptyString.php Class Class source
  Plain text file LiteralBase.php Class Class source

  Files folder image Files  /  Mezon  /  Rules  /  Terminal  /  Literal  /  CaseInSensitive  
File Role Description
  Plain text file CaseInSensitiveLiteral.php Class Class source
  Plain text file CaseInSensitiveLiteralOrNothing.php Class Class source
  Plain text file CaseInSensitiveLiteralOrNothingBase.php Class Class source

  Files folder image Files  /  Mezon  /  Rules  /  Terminal  /  Literal  /  CaseSensitive  
File Role Description
  Plain text file CaseSensitiveLiteral.php Class Class source
  Plain text file CaseSensitiveLiteralBase.php Class Class source
  Plain text file CaseSensitiveLiteralOrNothing.php Class Class source

  Files folder image Files  /  Mezon  /  Tests  
File Role Description
Files folder imageRealLifeCases (1 file)
Files folder imageRules (5 files, 2 directories)
  Plain text file IteratorNextUnitTest.php Class Class source
  Plain text file ValidateUnitTest.php Class Class source

  Files folder image Files  /  Mezon  /  Tests  /  RealLifeCases  
File Role Description
  Plain text file FixPointFloatUnitTest.php Class Class source

  Files folder image Files  /  Mezon  /  Tests  /  Rules  
File Role Description
Files folder imageCaseSensitive (4 files)
Files folder imageCharSet (4 files)
  Plain text file AnyRuleFromSetUnitTest.php Class Class source
  Plain text file ComplexConstructorsUnitTest.php Class Class source
  Plain text file CompoundRuleUnitTest.php Class Class source
  Plain text file EmptyStringUnitTest.php Class Class source
  Plain text file RulesInAnyOrderUnitTest.php Class Class source

  Files folder image Files  /  Mezon  /  Tests  /  Rules  /  CaseSensitive  
File Role Description
  Plain text file CaseInSensitiveLit...NothingUnitTest.php Class Class source
  Plain text file CaseInSensitiveLiteralUnitTest.php Class Class source
  Plain text file CaseSensitiveLiter...NothingUnitTest.php Class Class source
  Plain text file CaseSensitiveLiteralUnitTest.php Class Class source

  Files folder image Files  /  Mezon  /  Tests  /  Rules  /  CharSet  
File Role Description
  Plain text file OneExactlyOrNothingUnitTest.php Class Class source
  Plain text file OneExactlyUnitTest.php Class Class source
  Plain text file OneOrMoreOrNothingUnitTest.php Class Class source
  Plain text file OneOrMoreUnitTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:39
This week:0
All time:10,464
This week:423Up
For more information send a message to info at phpclasses dot org.