Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6715705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:38:44+00:00 2026-05-26T08:38:44+00:00

I am trying to learn to build a simple compiler as a hobby. I

  • 0

I am trying to learn to build a simple compiler as a hobby. I am targeting the Java virtual machine.

I have written a simple grammar using ANTLR plugin for Eclipse .

Someone told me that there is something known as a method node on the AST generated by Antlr, and that has to be called.
I am planning to use ASM to generate the bytecode.
So what is the method node and How do I call it from ASM and make it visit method instructions?

Also what about the semantic analyzer of a compiler. Should that be manually written or are there any generators for it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:38:45+00:00Added an answer on May 26, 2026 at 8:38 am

    You ask many unrelated questions in here. Depending on the language you define, there may be a method node in your language or there won’t be any, say, if your language compiles to a main(String[]) method unconditionally.

    There are multiple approaches to transform an AST to a target language. Mostly you would not generate code directly, but generate an AST for your target platform and have a pretty printer generate code out of it, using a treewalker.

    The semantic analysis is the programming of a compiler. Reading and understanding the input on a syntactically level is the parsing. You will need to write the semantic analyzer on your own or you would not have written a compiler at all. 😉

    I presume you use Jasmin to compile the assembly code? A very good start would be writing grammars for your input language and the target language (Jasmin) and think about, which input structures would render what output. How would one write a for i := 1 to 10 loop in Jasmin? Tackle small problems and expand your compiler as needed, but slowly, testing newly implemented transformations early and thoroughly.

    A very good reading: Let’s Build a Compiler, by Jack Crenshaw.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written the following simple test in trying to learn Castle Windsor's Fluent
I'm trying to learn how to build apps for Android. The first simple app,
I am trying to build a simple calculator to learn javascript/jquery but seem to
Im trying to learn to build navigation menus using css. Ive stripped loads of
Trying to learn about php's arrays today. I have a set of arrays like
In trying to learn how to create objects in ActionScript, I have had no
I'm trying to build a simple proof-of-concept business application in Silverlight and I keep
I am trying to build a simple metronome app and I am wondering if
I'm trying to learn python and have encountered some strange behaviour. I am experimenting
So I'm trying to learn C++ and I've gotten as far as using header

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.