PHP Classes
elePHPant
Icontem

File: rules.ini.php

Recommend this page to a friend!
  Classes of Mike Gamble  >  PHP Token Parser Engine  >  rules.ini.php  >  Download  
File: rules.ini.php
Role: Configuration script
Content type: text/plain
Description: Configuration file required by class
Class: PHP Token Parser Engine
Parse PHP code to check if it matches syntax rules
Author: By
Last change:
Date: 5 years ago
Size: 4,672 bytes
 

 

Contents

Class file image Download
;<?php
;die();
;
/*

;RULES CONFIGURATION FILE
;Use semicolon to comment lines

;Each definition contains: type, last, current, action
;Some definitions have a string to define item when closing (C, P)

;ACTION CODES:
;F - first - add to empty stack
;A - add - add token value as last and add to code
;I - ignore
;D - discard - remove item without popping or defining
;N - new - create stack item
;P - pop - define item if string provided
;C - close - define item
;R - reinitialize - change initial to current value, usually used when object operaters are encountered
;IF CURRENT == 999, action will be closing definition, such as function, variable, etc.

;RULES FOR AN EMPTY STACK:

rule[] = "1:1:309:F" ; $a
rule[] = "1:1:307:F" ; a
rule[] = "1:1:593:P" ; ]
rule[] = "1:1:625:P" ; }
rule[] = "1:1:379:N" ; {
rule[] = "1:1:260:F" ; eval
;rule[] = "1:1:316:F" ; echo
;rule[] = "1:1:336:F" ; return
;rule[] = "1:1:362:F" ; array

;SIMPLE ONE LINE RULES

rule[] = "260:260:999:C:eval" ; eval(
;rule[] = "316:316:999:C:echo" ; echo "
;rule[] = "336:336:999:C:return" ; return;
;rule[] = "362:362:999:C:array" ; array(

;RULES STARTING WITH A T_VARIABLE:

rule[] = "309:309:999:C:var" ; $a =
rule[] = "309:309:375:I" ; $a
rule[] = "309:309:359:R" ; $a->
rule[] = "309:309:380:R" ; $a::
rule[] = "309:309:540:C:var_fx" ; $a(
rule[] = "309:309:591:N" ; $a[
rule[] = "309:309:623:N" ; $a{
rule[] = "309:309:593:P:var" ; $a]
rule[] = "309:309:625:P:var" ; $a}
rule[] = "309:307:999:C:obj_var" ; $a->b =
rule[] = "309:307:375:I" ; $a->b
rule[] = "309:307:540:C:obj_fx" ; $a->b(
rule[] = "309:307:591:N" ; $a->b[
rule[] = "309:307:623:N" ; $a->b{
rule[] = "309:307:591:P:obj_var" ; $a->b]
rule[] = "309:307:625:P:obj_var" ; $a->b}
rule[] = "309:593:999:C:var" ; $a[1] =
rule[] = "309:593:375:I" ; $a[1]
rule[] = "309:593:359:R" ; $a[1]->
rule[] = "309:593:380:R" ; $a[1]::
rule[] = "309:593:540:C:var_fx" ; $a[1](
rule[] = "309:593:591:N" ; $a[1][
rule[] = "309:593:623:N" ; $a[1]{
rule[] = "309:593:591:P:var" ; $a[1]]
rule[] = "309:593:625:P:var" ; $a[1]}
rule[] = "309:625:999:C:var" ; $a{$b->c} =
rule[] = "309:625:375:I" ; $a{$b->c}
rule[] = "309:625:359:R" ; $a{$b->c}->
rule[] = "309:625:380:R" ; $a{$b->c}::
rule[] = "309:625:540:C:var_fx" ; $a{$b->c}(
rule[] = "309:625:591:N" ; $a{$b->c}[
rule[] = "309:625:623:N" ; $a{$b->c}{
rule[] = "309:625:591:P:var" ; $a{$b->c}]
rule[] = "309:625:625:P:var" ; $a{$b->c}}

;RULES STARTING WITH A STRING:

rule[] = "307:307:999:D" ; a
rule[] = "307:307:375:I" ; a
rule[] = "307:307:380:R" ; a::
rule[] = "307:307:540:C:fx" ; a(

;RULES STARTING WITH CLASS ARROW OPERATOR (->)
;These rules will usually be the result of redefinition (R)

rule[] = "359:359:999:C:obj_var" ; $a-> =
rule[] = "359:359:375:I" ; $a->
rule[] = "359:359:307:A" ; $a->b
rule[] = "359:359:309:A" ; $a->$b
rule[] = "359:359:623:N" ; $a->{
rule[] = "359:359:540:C:att_fx" ; $a->{$b}(
rule[] = "359:309:999:C:obj_var" ; $a->$b =
rule[] = "359:309:359:R" ; $a->$b->
rule[] = "359:309:380:R" ; $a->$b::
rule[] = "359:309:540:C:att_fx" ; $a->$b(
rule[] = "359:309:591:N" ; $a->$b[
rule[] = "359:309:593:P:obj_var" ; $a->$b]
rule[] = "359:309:625:P:obj_var" ; $a->$b}
rule[] = "359:307:999:C:obj_var" ; $a->b =
rule[] = "359:307:359:R" ; $a->b->
rule[] = "359:307:380:R" ; $a->b::
rule[] = "359:307:540:C:obj_fx" ; $a->b(
rule[] = "359:307:591:N" ; $a->b[
rule[] = "359:307:593:P:obj_var" ; $a->b]
rule[] = "359:307:625:P:obj_var" ; $a->b}

;RULES STARTING WITH CLASS DOUBLE COLON OPERATOR (::)
;These rules will usually be the result of redefinition (R)

rule[] = "380:380:999:C:obj_var" ; $a:: =
rule[] = "380:380:375:I" ; $a::
rule[] = "380:380:307:A" ; $a::b
rule[] = "380:380:309:A" ; $a::$b
rule[] = "380:380:623:N" ; $a::{
rule[] = "380:380:540:C:att_fx" ; $a::{$b}(
rule[] = "380:309:999:C:obj_var" ; $a::$b =
rule[] = "380:309:359:R" ; $a::$b->
rule[] = "380:309:380:R" ; $a::$b::
rule[] = "380:309:540:C:att_fx" ; $a::$b(
rule[] = "380:309:591:N" ; $a::$b[
rule[] = "380:309:593:P:obj_var" ; $a::$b]
rule[] = "380:309:625:P:obj_var" ; $a::$b}
rule[] = "380:307:999:C:obj_var" ; $a::b =
rule[] = "380:307:359:R" ; $a::b->
rule[] = "380:307:380:R" ; $a::b::
rule[] = "380:307:540:C:obj_fx" ; $a::b(
rule[] = "380:307:591:N" ; $a::b[
rule[] = "380:307:593:P:obj_var" ; $a::b]
rule[] = "380:307:625:P:obj_var" ; $a::b}

;*/

;?>