basic-parsing

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Basic Parsing Example

This example demonstrates how to use the PHP parser to parse PHP code and examine the resulting AST.

What it does

  • Takes a sample PHP code string containing variables, functions, and classes
  • Creates a lexer and parser instance
  • Parses the code into an Abstract Syntax Tree (AST)
  • Displays basic information about the parsed statements
  • Shows the full AST structure

Running the example

cd examples/basic-parsing
go run main.go

Expected output

The program will display:

  • Number of parsed statements
  • A list of each statement type
  • The complete AST structure in string format

This is the foundation for more complex PHP code analysis tasks.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL