apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: PHP_Parser_DocblockParser_Tokenizer

Source Location: /PHP_Parser_DocblockParser-0.1.1/DocblockParser/Tokenizer.php

Class Overview


The tokenizer wrapper for parser - implements the 'standard?' yylex interface


Author(s):

Version:

  • $Id: Tokenizer.php 231255 2007-03-05 20:42:42Z cellog $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 46]
The tokenizer wrapper for parser - implements the 'standard?' yylex interface

2 main methods:

  • Version: $Id: Tokenizer.php 231255 2007-03-05 20:42:42Z cellog $


[ Top ]


Class Variables

$debug =  false

[line 55]

Debugging on/off
  • Access: public

Type:   boolean


[ Top ]

$line =

[line 76]

Current line.
  • Access: public

Type:   int


[ Top ]

$N =  0

[line 69]

Total Number of tokens.
  • Access: public

Type:   int


[ Top ]

$pos =  -1

[line 83]

Current token position.
  • Access: public

Type:   int


[ Top ]

$token =

[line 91]

The current token (either a ord(';') or token numer - see php tokenizer.
  • Access: public

Type:   int


[ Top ]

$tokens =

[line 62]

Tokens - array of all the tokens.
  • Access: public

Type:   array


[ Top ]

$value =

[line 100]

The value associated with a token - eg. for T_STRING it's the string
  • Access: public

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 120]

none __construct( string $data, [ $options = array()])

Constructor

Load the tokenizer - with a string to tokenize. tidies up array, sets vars pos, line, N and tokens

  • Access: public

Parameters:

string   $data   —  PHP code to serialize
   $options   — 

[ Top ]

advance   [line 139]

boolean advance( )

The main advance call required by the parser

return true if a token is available, false if no more are available. skips stuff that is not a valid token stores lastcomment, lastcommenttoken

  • Return: - true = have tokens
  • Access: public

[ Top ]

getValue   [line 165]

void getValue( )


[ Top ]

parseError   [line 178]

string parseError( )

return something useful, when a parse error occurs.

used to build error messages if the parser fails, and needs to know the line number..

  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:41:15 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.