国产欧美精品一区二区,中文字幕专区在线亚洲,国产精品美女网站在线观看,艾秋果冻传媒2021精品,在线免费一区二区,久久久久久青草大香综合精品,日韩美aaa特级毛片,欧美成人精品午夜免费影视

基于JavaCC的抽象語(yǔ)法樹(shù)生成錯誤處理技術(shù)研究
DOI:
CSTR:
作者:
作者單位:

北京郵電大學(xué)

作者簡(jiǎn)介:

通訊作者:

中圖分類(lèi)號:

基金項目:

國家自然科學(xué)基金項目(面上項目,重點(diǎn)項目,重大項目)


Research on Error Handling Technology of Abstract Syntax Tree Generation Based on JavaCC
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 圖/表
  • |
  • 訪(fǎng)問(wèn)統計
  • |
  • 參考文獻
  • |
  • 相似文獻
  • |
  • 引證文獻
  • |
  • 資源附件
  • |
  • 文章評論
    摘要:

    隨著(zhù)C++語(yǔ)言標準的不斷演進(jìn),詞法語(yǔ)法解析工具如JavaCC等對于很多擴充的新特性以及復雜的語(yǔ)法結構不能做到完全支持,這可能會(huì )導致抽象語(yǔ)法樹(shù)生成錯誤且不完整。針對這一問(wèn)題,提出一個(gè)針對抽象語(yǔ)法樹(shù)生成錯誤的處理框架。首先,通過(guò)對JavaCC的擴充,實(shí)現一套可以解析C++語(yǔ)言的詞法語(yǔ)法分析器,生成抽象語(yǔ)法樹(shù)并記錄報錯行;其次,根據報錯行尋找所在函數區間即不支持或不匹配的語(yǔ)法片段;最后,通過(guò)注釋函數區間的方式來(lái)跳過(guò)不支持或不匹配的語(yǔ)法片段進(jìn)行錯誤處理并迭代生成抽象語(yǔ)法樹(shù)。實(shí)驗結果表明,對抽象語(yǔ)法樹(shù)生成進(jìn)行錯誤處理后可以更全面的分析代碼,抽象語(yǔ)法樹(shù)完成率上升37.8%,分析行數提高3.9倍。

    Abstract:

    With the continuous evolution of the C++ language standard, lexical parsing tools such as JavaCC cannot fully support many expanded new features and complex grammatical structures, which may lead to incorrect and incomplete abstract syntax tree generation. Aiming at this problem, a framework for processing errors generated by abstract syntax trees is proposed. First, through the expansion of JavaCC, a set of lexical parsers that can parse C++ language are implemented, generate abstract syntax trees and record error lines; secondly, look for grammatical fragments that are not supported or do not match in the function range according to the error line; finally , By annotating function intervals, skip unsupported or unmatched grammar fragments for error handling and iteratively generate an abstract syntax tree. The experimental results show that the code can be analyzed more comprehensively after the error processing of the abstract syntax tree generation. The abstract syntax tree completion rate increased by 37.8%, and the number of analysis lines increased by 3.9 times.

    參考文獻
    相似文獻
    引證文獻
引用本文

王國隆,金大海,宮云戰.基于JavaCC的抽象語(yǔ)法樹(shù)生成錯誤處理技術(shù)研究計算機測量與控制[J].,2022,30(2):151-159.

復制
分享
文章指標
  • 點(diǎn)擊次數:
  • 下載次數:
  • HTML閱讀次數:
  • 引用次數:
歷史
  • 收稿日期:2021-11-30
  • 最后修改日期:2021-12-27
  • 錄用日期:2021-12-31
  • 在線(xiàn)發(fā)布日期: 2022-02-22
  • 出版日期:
文章二維碼
琼结县| 牡丹江市| 清远市| 大渡口区| 秦安县| 禄丰县| 信宜市| 斗六市| 水城县| 三河市| 开鲁县| 东明县| 乐昌市| 林芝县| 筠连县| 嘉黎县| 来宾市| 罗平县| 泗阳县| 佳木斯市| 河西区| 繁峙县| 萍乡市| 阜阳市| 汉阴县| 米泉市| 安仁县| 札达县| 合川市| 安庆市| 青神县| 图们市| 永善县| 汨罗市| 永济市| 丹阳市| 山东省| 澎湖县| 昌乐县| 延吉市| 柳江县|