Program Language Translation Using a Grammar-Driven Tree-to-Tree Model

07/04/2018
by   Mehdi Drissi, et al.
0

The task of translating between programming languages differs from the challenge of translating natural languages in that programming languages are designed with a far more rigid set of structural and grammatical rules. Previous work has used a tree-to-tree encoder/decoder model to take advantage of the inherent tree structure of programs during translation. Neural decoders, however, by default do not exploit known grammar rules of the target language. In this paper, we describe a tree decoder that leverages knowledge of a language's grammar rules to exclusively generate syntactically correct programs. We find that this grammar-based tree-to-tree model outperforms the state of the art tree-to-tree model in translating between two programming languages on a previously used synthetic task.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/04/2019

A Denotational Engineering of Programming Languages

The book is devoted to two research areas: (1) Designing programming lan...
research
02/11/2018

Tree-to-tree Neural Networks for Program Translation

Program translation is an important tool to migrate legacy code in one l...
research
08/16/2023

Types, equations, dimensions and the Pi theorem

The languages of mathematical physics and modelling are endowed with a r...
research
05/23/2023

Physics of Language Models: Part 1, Context-Free Grammar

We design experiments to study how generative language models, like GPT,...
research
04/03/2022

MSCCD: Grammar Pluggable Clone Detection Based on ANTLR Parser Generation

For various reasons, programming languages continue to multiply and evol...
research
03/27/2018

Towards Zero-Overhead Disambiguation of Deep Priority Conflicts

**Context** Context-free grammars are widely used for language prototypi...
research
09/08/2023

A Rapid Prototyping Language Workbench for Textual DSLs based on Xtext: Vision and Progress

Metamodel-based DSL development in language workbenches like Xtext allow...

Please sign up or login with your details

Forgot password? Click here to reset