Item type |
Trans(1) |
公開日 |
2019-09-18 |
タイトル |
|
|
タイトル |
構文誤りを含むプログラムのブロック言語表現への変換手法 |
タイトル |
|
|
言語 |
en |
|
タイトル |
A Method of Conversion from Text-based Languages with Syntax Error to Block-based Visual Languages |
言語 |
|
|
言語 |
jpn |
キーワード |
|
|
主題Scheme |
Other |
|
主題 |
[発表概要,Unrefereed Presentation Abstract] |
資源タイプ |
|
|
資源タイプ識別子 |
http://purl.org/coar/resource_type/c_6501 |
|
資源タイプ |
journal article |
著者所属 |
|
|
|
法政大学大学院情報科学研究科 |
著者所属 |
|
|
|
法政大学情報科学部 |
著者所属(英) |
|
|
|
en |
|
|
Graduate School of Computer and Information Sciences, Hosei University |
著者所属(英) |
|
|
|
en |
|
|
Faculty of Computer and Information Sciences, Hosei University |
著者名 |
山梨, 裕矢
佐々木, 晃
|
著者名(英) |
Yuya, Yamanashi
Akira, Sasaki
|
論文抄録 |
|
|
内容記述タイプ |
Other |
|
内容記述 |
初学者向けのプログラミング言語としてブロック型言語が用いられる場合がある.学習効率を上げるためにブロック型言語とテキスト記述形式の言語の間で変換できるようにしたものも存在するが,ブロックの構成が不完全な状態からテキスト表現に変換されたプログラムでは構文誤りが発生してしまう,という問題がある.さらに,このような不完全なテキスト表現のプログラムは,構文解析が行えないため,通常のパーザーを用いてブロックへ変換することができない.本発表では,ブロック型言語から生成される構文誤りの特徴に着目し,各ブロックから必ず生成されるキーワードになる単語からPEG(Parsing Expression Grammar)によるパーザーを用いて正しい構文の推定を行う.構文を構成するうえで足りない箇所については仮のトークンを置き,構文誤りを回避することによって構文誤り発生時にもブロック型言語への変換を可能にさせる.PEGを用いるためテキストからブロックへ変換する際のあいまいさがなく変換時に無限ループに陥ることはない.この手法の実装を,JavaScript言語とBlocklyで作成したブロック型言語間の変換に対して行った.提案手法では,不完全なブロックの表現をテキストに変換することによって発生した構文誤りを含むプログラムでも,元のブロック型言語プログラムに変換することが示された.また,構文を入力している途中のような不完全な状態でも変換が可能になったために,構文の一部分を入力するだけでブロックへの変換を行える. |
論文抄録(英) |
|
|
内容記述タイプ |
Other |
|
内容記述 |
Block-based visual languages are often used by novice programmers. Some blocks environments provide a bi-directional transformation between a traditional text language and a block-based language. Such dual-mode tools provide that users may benefit from the learnability of blocks in block-based mode, while they learn syntax and get the efficiency of text in text-based mode. However, incomplete code in block-based language may produce syntactically erroneous program. Such incomplete code cannot be parsed, so they aren't converted back to blocks using normal parsers. In this research, we focus on the characteristics of syntax errors in program generated from incomplete code in block-based language and propose a method to predict correct syntax for incomplete code. A PEG (Parsing Expression Grammar)-based parser enables to parse incomplete program and predict correct syntax based on keywords necessarily generated from each block. Then, special tokens are inserted for incomplete part of code to obtain parsable code. This also enables to convert syntactically incomplete program text to visual blocks. Using this method we implemented a bi-directional converter between JavaScript language and a block-based visual language created with Blockly. Even programs containing syntax errors in JavaScript caused by generating from incomplete block representation can be translated back into the original block-based program. In addition, it enables immediate conversion from a partial code fragment typed by a programmer to blocks. |
書誌レコードID |
|
|
収録物識別子タイプ |
NCID |
|
収録物識別子 |
AA11464814 |
書誌情報 |
情報処理学会論文誌プログラミング(PRO)
巻 12,
号 3,
p. 6-6,
発行日 2019-09-18
|
ISSN |
|
|
収録物識別子タイプ |
ISSN |
|
収録物識別子 |
1882-7802 |
出版者 |
|
|
言語 |
ja |
|
出版者 |
情報処理学会 |