Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where can I get the reference table of the node type? #501

Open
Sewens opened this issue May 14, 2018 · 7 comments
Open

Where can I get the reference table of the node type? #501

Sewens opened this issue May 14, 2018 · 7 comments

Comments

@Sewens
Copy link

Sewens commented May 14, 2018

This maybe a stupid question, but I read all the documents about this project still cannot find a full referrence table.
Currently I only know that 'Stmt' stands for 'statement' and 'Expr' means 'expression'.

@nikic
Copy link
Owner

nikic commented May 14, 2018

There is no reference table, though if someone wants to create one, that would be great.

Generally my recommended approach would be to parse + dump the code you're interested in to see what nodes are used. Alternatively, if you want to familiarize yourself with all nodes types, go through the file names on https://github.com/nikic/PHP-Parser/tree/master/lib/PhpParser/Node.

@carusogabriel
Copy link
Contributor

carusogabriel commented May 19, 2018

@nikic @Sewens Something like:

Class Node
PhpParser\Node\Expr\BinaryOp\NotIdentical !==

?

@nikic
Copy link
Owner

nikic commented May 19, 2018

@carusogabriel Yeah, something like that. Maybe could also list the subnodes?

@TomasVotruba
Copy link
Contributor

TomasVotruba commented Feb 21, 2019

FYI, I'm working on this in @rectorphp, so people can learn more effectively

rectorphp/rector#1100

@TomasVotruba
Copy link
Contributor

Here is the table: https://github.com/rectorphp/rector/blob/master/docs/NodesOverview.md

I thought about adding example of construction + kind alternatives (e.g. for array() and [])
Any UX feedback is welcomed!

I plan to add it to https://getrector.org static website, so we can filter them with JavaScript

@danon
Copy link

danon commented Dec 19, 2022

Here is the table: https://github.com/rectorphp/rector/blob/master/docs/NodesOverview.md

Is there an updated version somewhere? The link appears to be dead.

@TomasVotruba
Copy link
Contributor

Yes, here it is :)
https://github.com/rectorphp/php-parser-nodes-docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants