package de.dhbw.compiler.antlrxcompiler;

import java.util.stream.Collectors;

import org.antlr.stringtemplate.StringTemplate;

public class StringTemplateBuilder {
    private static SymbolTable symbols = SymbolTable.getInstance();

    public static StringTemplate declList() {
        return new StringTemplate(
                symbols.values()
                       .stream()
                       .map(symbol -> symbol.type.getJavaType() + " = " + symbol.name + ";")
                       .collect(Collectors.joining("\n"))
        );
    }


}

