Translation of Natural Language to Source Code in the Case of Repetition in Pascal Language - Adi Yusuf; Aditya Kusuma Setyanegara; Muhammad Raafi Febrian Tara (CV Projurnal Mitra Publikasi, 2025)
Source code in computer science is a set of commands used to solve problems written in languages that can be understood by computers. Programming languages use concise syntax, and due to this conciseness, they avoid redundancy and ambiguity. However, these languages are often difficult to learn because they require strict adherence to specific syntactic rules. One approach to minimize the difficulty for programmers is to allow program writing using natural language, which is more flexible and easier for humans to understand. Therefore, this research aims to translate natural language, specifically Indonesian, into Pascal source code. The method applied is a rule-based method consisting of three stages: preprocessing (case folding and filtering), analysis (scanning and parsing), and translation. The preprocessing stage removes noise, the analysis stage checks conformity with the defined grammar, and the translation stage converts Indonesian commands into Pascal syntax. Testing was conducted using 60 Indonesian command texts across three types of loop structures (for do, while do, and repeat until). The system achieved an accuracy of approximately 95%. The results show that the rule-based approach is effective in translating repetitive structures. However, improvements to the grammar and parsing rules are recommended to address translation errors and further enhance system accuracy.