2017 © Pedro Peláez
 

library sparser

parser of string

image

niceforbear/sparser

parser of string

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

String Parser

Install

Via Composer, (*1)

``` bash $ composer require niceforbear/sparser, (*2)


## Usage ``` php $context = new Context(); $user_in = "\$input equals '4' or \$input equals 'four'"; $reader = new StringReader($user_in); $scanner = new Scanner($reader, $context); while ($scanner->nextToken() != Scanner::EOF) { print $scanner->token(); print "\t{$scanner->char_no()}"; print "\t{$scanner->getTypeString()}\n"; }
$input = 'five';
$statement = "( \$input equals 'five')";

$engine = new MarkParse($statement);
$result = $engine->evaluate($input);
print "input: $input evaluating: $statement\n";
if($result){
    print "true!\n";
}else{
    print "false!\n";
}

Testing

Tests unavailable., (*3)

Contributing

Please see CONTRIBUTING for details., (*4)

Credits

License

The MIT License (MIT). Please see License File for more information., (*5)

About EBNF

  • expr ::= operand (orExpr | andExpr) *
  • operand ::= ( '(' expr ')' | | variable ) (eqExpr) *
  • orExpr ::= 'or' operand
  • andExpr ::= 'and' operand
  • eqExpr ::= 'equals' operand
  • variable ::= '$'

The Versions

19/06 2016

dev-master

9999999-dev https://github.com/niceforbear

parser of string

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

parser string basic tool

19/06 2016

v0.1.2

0.1.2.0 https://github.com/niceforbear

parser of string

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

parser string basic tool

19/06 2016

v0.1.1

0.1.1.0 https://github.com/niceforbear

parser of string

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

parser string basic tool

19/06 2016

v0.1.0

0.1.0.0 https://github.com/niceforbear

parser of string

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

parser string basic tool