2017 © Pedro Peláez
 

library lib-tokenizer

Tokenizer library of the Ride framework.

image

ride/lib-tokenizer

Tokenizer library of the Ride framework.

  • Thursday, March 29, 2018
  • by ride-user
  • Repository
  • 7 Watchers
  • 1 Stars
  • 4,209 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 2 % Grown

The README.md

Ride: Tokenizer Library

This library gives you some classes to parse a string into tokens., (*1)

Code Sample

Some example code in the context of the ORM module:, (*2)

<?php

use ride\library\tokenizer\symbol\NestedSymbol;
use ride\library\tokenizer\symbol\SimpleSymbol;
use ride\library\tokenizer\Tokenizer;

$tokenizer = new Tokenizer();
$tokenizer->setWillTrimTokens(true);
$tokenizer->addSymbol(new SimpleSymbol('AND'));
$tokenizer->addSymbol(new SimpleSymbol('OR'));
$tokenizer->addSymbol(new NestedSymbol('(', ')', $tokenizer));

$condition = '{field} = %2% AND {field2} <= %1%';
$tokens = $tokenizer->tokenize($condition);
// array(
//    '{field} = %2%', 
//    'AND', 
//    '{field2} <= %1%'
// )

$condition = '{field} = 5 AND ({field2} <= %1% OR {field2} >= %2%)';
$tokens = $tokenizer->tokenize($condition);
// array(
//    '{field} = 5', 
//    'AND', 
//    array(
//        '{field2} <= %1%'), 
//        'OR', 
//        '{field2} >= %2%'),
//    )
// )

Implementations

For more examples, you can check the following implementation of this library: - ride/lib-orm, (*3)

Installation

You can use Composer to install this library., (*4)

composer require ride/lib-tokenizer

The Versions

29/03 2018

dev-master

9999999-dev

Tokenizer library of the Ride framework.

  Sources   Download

The Requires

  • php >=5.3

 

The Development Requires

by Joris Vandeweerd

29/03 2018

dev-develop

dev-develop

Tokenizer library of the Ride framework.

  Sources   Download

The Requires

  • php >=5.3

 

The Development Requires

by Joris Vandeweerd

29/03 2018

1.0.2

1.0.2.0

Tokenizer library of the Ride framework.

  Sources   Download

The Requires

  • php >=5.3

 

The Development Requires

by Joris Vandeweerd

29/03 2018

dev-peter279k-test_enhancement

dev-peter279k-test_enhancement

Tokenizer library of the Ride framework.

  Sources   Download

The Requires

  • php >=5.3

 

The Development Requires

by Joris Vandeweerd

08/09 2016

1.0.1

1.0.1.0

Tokenizer library of the Ride framework.

  Sources   Download

by Joris Vandeweerd

21/06 2016

1.0.0

1.0.0.0

Tokenizer library of the Ride framework.

  Sources   Download

by Joris Vandeweerd

24/06 2015

0.1.1

0.1.1.0

Tokenizer library of the Ride framework.

  Sources   Download

by Joris Vandeweerd

14/01 2014

0.1.0

0.1.0.0

Tokenizer library of the Pallo framework.

  Sources   Download

by Joris Vandeweerd