File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 11import * as peggy from 'peggy'
22import { AST } from '../ast/types/packages-and-modules'
3+ import { ClassFile } from '../ClassFile/types'
34import { Compiler } from './compiler'
45import { javaPegGrammar } from './grammar'
5- import { BinaryWriter } from './binary-writer'
66
7- export const compile = ( ast : AST ) : string => {
7+ export const compile = ( ast : AST ) : ClassFile => {
88 const compiler = new Compiler ( )
9- const classFile = compiler . compile ( ast )
10-
11- const binaryWriter = new BinaryWriter ( )
12- const byteArray = binaryWriter . generateBinary ( classFile )
13- const base64encoded = Buffer . from ( byteArray ) . toString ( 'base64' )
14-
15- return base64encoded
9+ return compiler . compile ( ast )
1610}
1711
18- export const compileFromSource = ( javaProgram : string ) : string => {
12+ export const compileFromSource = ( javaProgram : string ) : ClassFile => {
1913 const parser = peggy . generate ( javaPegGrammar , {
2014 allowedStartRules : [ 'CompilationUnit' ] ,
2115 cache : true
You can’t perform that action at this time.
0 commit comments