Home > Papers

 
 
An Abstract Syntax Tree Construction Analysis Model Based on JavaCC
WANG Guolong,JIN Dahai *
State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications, Beijing 100876;State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications, Beijing 100876
*Correspondence author
#Submitted by
Subject:
Funding: none
Opened online:14 January 2022
Accepted by: none
Citation: WANG Guolong,JIN Dahai.An Abstract Syntax Tree Construction Analysis Model Based on JavaCC[OL]. [14 January 2022] http://en.paper.edu.cn/en_releasepaper/content/4756084
 
 
Abstract syntax tree (AST) was an important intermediate expression form of code. Aiming at the deficiencies of existing lexical and syntax analysis tool JavaCC (Java Compiler Compiler) that it did not support the new C++ standard and did not have a good error handling mechanism, an abstract syntax tree construction analysis model based on JavaCC was proposed in this paper. First, C++ grammar rules through the EBNF (Extended Backus-Naur Form) are defined, and a rule expansion method is proposed to deal with future syntax updates. Secondly, a syntax tree is constructed based on the JavaCC by generating lexical and grammar parser, and the key information is extracted through traversing the syntax tree. Thirdly, some strategies are proposed such as embedding Java code, skipping mismatched grammatical fragments, and constructing the feature hash of syntax tree nodes for error handling. Finally, a prototype system based on this model is designed and developed in this paper, and the effectiveness of the model in both time and space dimensions is verified through open source engineering experiments adopting C++ new standard.
Keywords:C++;syntax tree;JavaCC;syntax change;error handling;construction analysis model
 
 
 

For this paper

  • PDF (0B)
  • ● Revision 0   
  • ● Print this paper
  • ● Recommend this paper to a friend
  • ● Add to my favorite list

    Saved Papers

    Please enter a name for this paper to be shown in your personalized Saved Papers list

Tags

Add yours

Related Papers

Statistics

PDF Downloaded 25
Bookmarked 0
Recommend 0
Comments Array
Submit your papers