Class Parser

Description

Base parsing class

  • abstract:
  • since: 1.0

Located in /Parsing/Parser.php (line 24)


	
			
Direct descendents
Class Description
DeltaParser Class for parsing delta times
EventParser Class for parsing MIDI events
FileParser Class for parsing MIDI files
TrackParser Class for parsing MIDI tracks
Variable Summary
SplFileObject $file
int $state
Method Summary
Parser __construct ()
void afterLoad ()
void afterSetFile ()
SplFileObject createFileObject (string $file)
int getDelta ()
int getState ()
void load (string|SplFileObject $file)
binary read (int $count, [bool $throwOnEof = false])
void setFile ( $file)
void setState (int $state)
Variables
SplFileObject $file (line 39)

The file to parse

  • access: protected
int $state (line 32)

The current state of the parser

Methods
Constructor __construct (line 46)

Constructor

  • since: 1.0
  • access: public
Parser __construct ()

Redefined in descendants as:
afterLoad (line 173)

Called after load()

void afterLoad ()

Redefined in descendants as:
afterSetFile (line 182)

Called after setFile()

void afterSetFile ()

Redefined in descendants as:
createFileObject (line 59)

Creates a file object suitable for load()

SplFileObject createFileObject (string $file)
  • string $file
getDelta (line 151)

Reads a delta time from the buffer stream

int getDelta ()
getState (line 103)

Gets the current parse state

The default is ParseState::EOF.

int getState ()
load (line 72)

Loads a file to be parsed

void load (string|SplFileObject $file)
  • string|SplFileObject $file: A file path, or an SplFileObject opened in "rb" mode
parse (line 193)

Parses the buffer stream and returns the next chunk

Chunk parse ()

Redefined in descendants as:
read (line 128)

Reads $count bytes from the buffer stream

binary read (int $count, [bool $throwOnEof = false])
  • int $count
  • bool $throwOnEof: Whether to throw a ParseException if EOF is encountered
setFile (line 89)

Sets the buffer stream to read from

void setFile ( $file)
  • SplFileObject $file
setState (line 114)

Sets the current parse state

void setState (int $state)

Documentation generated on Sun, 25 Oct 2009 22:38:19 -0700 by phpDocumentor 1.4.3