{"updated":"2025-01-20T03:08:17.144708+00:00","metadata":{"_oai":{"id":"oai:ipsj.ixsq.nii.ac.jp:00184909","sets":["934:935:8954:9278"]},"path":["9278"],"owner":"11","recid":"184909","title":["マクロ処理の実装に適したパックラットパーサーコンビネータの設計と実装"],"pubdate":{"attribute_name":"公開日","attribute_value":"2017-12-12"},"_buckets":{"deposit":"7a4573b5-a961-4255-9cd1-b72f14ec521b"},"_deposit":{"id":"184909","pid":{"type":"depid","value":"184909","revision_id":0},"owners":[11],"status":"published","created_by":11},"item_title":"マクロ処理の実装に適したパックラットパーサーコンビネータの設計と実装","author_link":["409691","409692","409689","409690"],"item_titles":{"attribute_name":"タイトル","attribute_value_mlt":[{"subitem_title":"マクロ処理の実装に適したパックラットパーサーコンビネータの設計と実装"},{"subitem_title":"Design and Implementation of Packrat Parser Combinator for Implementing Macro Processor","subitem_title_language":"en"}]},"item_keyword":{"attribute_name":"キーワード","attribute_value_mlt":[{"subitem_subject":"[発表概要] ","subitem_subject_scheme":"Other"}]},"item_type_id":"3","publish_date":"2017-12-12","item_3_text_3":{"attribute_name":"著者所属","attribute_value_mlt":[{"subitem_text_value":"芝浦工業大学大学院理工学研究科"},{"subitem_text_value":"芝浦工業大学大学院理工学研究科"}]},"item_3_text_4":{"attribute_name":"著者所属(英)","attribute_value_mlt":[{"subitem_text_value":"Graduate School of Engineering and Science, Shibaura Institute of Technology","subitem_text_language":"en"},{"subitem_text_value":"Graduate School of Engineering and Science, Shibaura Institute of Technology","subitem_text_language":"en"}]},"item_language":{"attribute_name":"言語","attribute_value_mlt":[{"subitem_language":"jpn"}]},"item_publisher":{"attribute_name":"出版者","attribute_value_mlt":[{"subitem_publisher":"情報処理学会","subitem_publisher_language":"ja"}]},"publish_status":"0","weko_shared_id":-1,"item_file_price":{"attribute_name":"Billing file","attribute_type":"file","attribute_value_mlt":[{"url":{"url":"https://ipsj.ixsq.nii.ac.jp/record/184909/files/IPSJ-TPRO1006004.pdf","label":"IPSJ-TPRO1006004.pdf"},"date":[{"dateType":"Available","dateValue":"2019-12-12"}],"format":"application/pdf","billing":["billing_file"],"filename":"IPSJ-TPRO1006004.pdf","filesize":[{"value":"100.5 kB"}],"mimetype":"application/pdf","priceinfo":[{"tax":["include_tax"],"price":"0","billingrole":"5"},{"tax":["include_tax"],"price":"0","billingrole":"6"},{"tax":["include_tax"],"price":"0","billingrole":"15"},{"tax":["include_tax"],"price":"0","billingrole":"44"}],"accessrole":"open_date","version_id":"5c410106-d23e-45a0-9716-12221fcd34df","displaytype":"detail","licensetype":"license_note","license_note":"Copyright (c) 2017 by the Information Processing Society of Japan"}]},"item_3_creator_5":{"attribute_name":"著者名","attribute_type":"creator","attribute_value_mlt":[{"creatorNames":[{"creatorName":"今泉, 良紀"}],"nameIdentifiers":[{}]},{"creatorNames":[{"creatorName":"篠埜, 功"}],"nameIdentifiers":[{}]}]},"item_3_creator_6":{"attribute_name":"著者名(英)","attribute_type":"creator","attribute_value_mlt":[{"creatorNames":[{"creatorName":"Yoshiki, Imaizumi","creatorNameLang":"en"}],"nameIdentifiers":[{}]},{"creatorNames":[{"creatorName":"Isao, Sasano","creatorNameLang":"en"}],"nameIdentifiers":[{}]}]},"item_3_source_id_9":{"attribute_name":"書誌レコードID","attribute_value_mlt":[{"subitem_source_identifier":"AA11464814","subitem_source_identifier_type":"NCID"}]},"item_resource_type":{"attribute_name":"資源タイプ","attribute_value_mlt":[{"resourceuri":"http://purl.org/coar/resource_type/c_6501","resourcetype":"journal article"}]},"item_3_source_id_11":{"attribute_name":"ISSN","attribute_value_mlt":[{"subitem_source_identifier":"1882-7802","subitem_source_identifier_type":"ISSN"}]},"item_3_description_7":{"attribute_name":"論文抄録","attribute_value_mlt":[{"subitem_description":"パックラット構文解析ではLALR(1)よりも強力な形式文法であるParsing Expression Grammar(以下PEG)によって構文解析を行う.PEGによる文法規則には曖昧さがなく,プログラミング言語の構文の記述やその処理系の作成に際し非常に有用である.既存のPEGベースの構文解析器では直接文字列を入力として受け付けるが,字句解析と構文解析を分けたい場合にそのままでは使用に適さない.たとえば,字句ベースのマクロ処理系であるCプリプロセッサを実装する際,マクロ展開後のコードに再度マクロ展開の処理が行われうる.その結果,マクロ展開の過程で同じレクシムに対して字句解析を複数回実行する場合がある.これを避けるためにPEGベースの構文解析器を使用しないとすると,字句解析や構文解析用にPEG以外の形式文法を学んだりその処理系を導入したりする必要がある.そこで文字列だけでなく字句列などを入力できるパックラットパーサーコンビネータをC++で実装し,本発表では実装の詳細について報告する.この実装を用いて生成した構文解析器はchar型だけでなく任意の型を返す前方反復子(Forward Iterator)を入力として受け付ける.結果はtuple・variant・optional・expectedなどを組み合わせたデータ構造として得られ,意味規則によって自由に変換することが可能である.","subitem_description_type":"Other"}]},"item_3_description_8":{"attribute_name":"論文抄録(英)","attribute_value_mlt":[{"subitem_description":"Packrat parsing is based on Parsing Expression Grammar (PEG), which is more expressive than LALR(1) and is not ambiguous. So it is useful on describing the syntax of a programming language and implementing the language. However, it is not suitable to use PEG-based parser generators when we separately implement lexical analysis and syntax analysis, since existing PEG-based parsers receive only a string. For example, since a C preprocessor, which is a token-based macro processor, may expand a code fragment that is obtained by expanding macros, a lexer may process same lexemes more than once in macro expansion. When we do not use PEG-based parser for avoiding unnecessary lexical analysis, we need to study and use another lexer and parser. In this presentation we report a packrat parser combinator, implemented in C++, that receives not only strings but also sequences of tokens. The parser described by the combinator can receive as its input a Forward Iterator that returns not only characters but also values of any type. The output of the parser is obtained as a data structure that consists of tuples, variants, optionals and expecteds. We can process the result by describing semantic actions.","subitem_description_type":"Other"}]},"item_3_biblio_info_10":{"attribute_name":"書誌情報","attribute_value_mlt":[{"bibliographicPageEnd":"1","bibliographic_titles":[{"bibliographic_title":"情報処理学会論文誌プログラミング(PRO)"}],"bibliographicPageStart":"1","bibliographicIssueDates":{"bibliographicIssueDate":"2017-12-12","bibliographicIssueDateType":"Issued"},"bibliographicIssueNumber":"6","bibliographicVolumeNumber":"10"}]},"relation_version_is_last":true,"weko_creator_id":"11"},"created":"2025-01-19T00:52:11.162266+00:00","id":184909,"links":{}}