Skip to content

An ANTLR based linker script syntax parser

Notifications You must be signed in to change notification settings

antoniovazquezblanco/LD-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LD Parser

Build CodeQL Maven Central

A Java parser for linker script (LD) format using ANTLR.

Usage

import io.ldparser.LDParser;
import io.ldparser.Script;
import io.ldparser.Command;
import io.ldparser.ProvideCommand;

import java.io.File;

// Parse from file
Script script = LDParser.parse(new File("script.ld"));

// Access commands
for (Command cmd : script.getCommands()) {
    if (cmd instanceof ProvideCommand) {
        ProvideCommand pc = (ProvideCommand) cmd;
        System.out.println("Symbol: " + pc.getSymbolName() + ", Expression: " + pc.getExpression());
    }
}

Development

Install Eclipse. Once in Eclipse click File > Open Projects from File System.... On the import dialog select LD-Parser folder and import the project.

You are ready for building, testing and developing.

Installing

The package is published to Maven Central and Github package repository.

Those pages provide installation snippets, visit them for more information.

About

An ANTLR based linker script syntax parser

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •