Getting php file attributes through java code - java

I have a php code file and i have to get all the attributes defined in that class using java code. Is there a way of doing so other than travesing through the file.

Look for a parser generator. My personal favorite is antlr.

Related

How to parse Java code to generate class diagram?

I have to generate class diagrams from the java files such that the parser must be executable on the command line with the following format:
umlparser classpath output_file_name
umlparser is my .java file name
classpath is a folder name where all the .java source files will be
output file name is the name of the output image file you program will generate ( .jpg, .png or .pdf format)
Tools for parsing Java Source and generating UML diagrams can be used.
I was looking at http://yuml.me/diagram/class/draw and found that that is a good way to generate the class diagram.
However, I can't get the idea how can I get the code in the form of
[Customer|forname:string;surname:string|doPost();doGet()]<>-orders*>[Order]
[Order]++-0..*>[LineItem]
[Order]-[note:Aggregate root{bg:wheat}]
Any insight on how to generate this code?
Any other suggestions are also welcomed.
Maybe you need to take a look at doxygraph. Its maintainers define the tool as follows:
It relies on Doxygen to parse your source code and create an intermediate XML representation of the information it collects, so it supports all the same programming languages that Doxygen supports: C, C++, C#, Objective C, Java, Python, PHP, Tcl, D, IDL, VHDL, and Fortran.
Reverse-engineering functionality is also present in IntelliJ IDEA and Visual Paradigm editors, but it is a paid feature as far as I can remember.

Java alternative to PHP Tokenizer

Is there any Java alternative to PHP Tokenizer?
http://php.net/manual/en/book.tokenizer.php
Edit: I mean Java class that parses Java like PHP Tokenizer parses PHP.
I quickly scanned the documentation you linked to. It looks like functionality for parsing PHP code.
If that is indeed what you are looking for, you might find the JavaParser project useful. It contains functionality for parsing Java source code.
This page contains some usage examples.

Generate java code from MathMl

I need a tool to parse MathML file and generate Java code represents this file, Do you know any tool do this processes partially or completely?
Take a look at this : JMathTeX

Importing .eps file into Java program

I need to parse an Encapsulated Post Script file into Java program. More specifically, I need to be able to extract simple vectors and curve elements from it, and manipulate them after this. Is there a Java library which can do this?
ToastScript looks like it may be what you are looking for.

Using of xml files in java programming

How to use .xml file in applet coding?
I want to save some context in .xml file in java-applet programming.....
I want to make the changes in that file through coding.
how to do this?
Your question is too broad, however if you are looking at how to process XML files with Java, then you should probably look at XML APIs for Java, for example jdom.
Tutorial: A good starting point to learn jdom
Try Apache XMLBeans. It converts between an XML file and a Java object so that you can work with the XML data in a simpler way.
You could also have a look at JAXB (http://jaxb.dev.java.net, http://en.wikipedia.org/wiki/JAXB) which also is a Java to XML binding component. Advantage: JAXB is part of SE version 1.6.

Categories

Resources