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 6111831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:40:32+00:00 2026-05-23T14:40:32+00:00

My question is the same as the title. I just want to know if

  • 0

My question is the same as the title. I just want to know if there are any other translation techniques to get the intermediate code that doesn’t rely on embedding actions into the parser (that is, the parser will strictly create the abstract syntax tree, it won’t generate any code). Thanks for any answers.

  • 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-23T14:40:33+00:00Added an answer on May 23, 2026 at 2:40 pm

    If you have a parser, then the parser has to do something more than just “recognize” the input stream as a valid instance of the language. If you want the compiler to produce anything, some kind of actions must be attached to activities in which langauge fragments are matched. In some sense, it can’t be anything but “syntax directed”; at the parsing stage, all you have is syntax.

    Fundamentally, the parsing actions have to build a representation of the program that is “more compilable”. I only know of a few basic methods:

    • Generate a set of virtual machine instructions
    • Build an abstract syntax tree to be passed to the rest of the compiler
    • Build some kind of control/data flow representation of the code (e.g, “triples”)

    These are all in the abstract really pretty much the same, in that the parser-generated representation contains linked structures whose elements have some direct semantic intepretation.
    These bits of structure with implied semantics are what the rest of the compiler keys off.

    Now, the text is a representation of the program. You can avoid the “parsing” process (sort of) completely if you decide to implement you compiler as a Post system, a set of rewriting rules over strings. These are of the form of “if you see this string, replace it by this other string”. Post system are provabaly Turing capable, so technically you can transform your source code into a string representing your target program with a sufficiently clever set of string rewriting rules. Nobody I know builds real compilers this way; I’m sure if you dig hard enough, you can find an obscure technical paper that does this.

    One could reasonably argue that matching strings, as required by the Post system, is a kind of parsing (e.g., recognizing interesting structure), putting you back at the original question.

    It is interesting to note that program transformation systems (I build one of these commercially) typically use a compiler front end to build ASTs, and then apply AST tree-to-tree rewrites to achieve thier purpose. The reason they are constructed this way is because they are really Post systems in diguise; any AST for your program can be trivally converted into a string (e.g., S-expressions), and the tree-rewrites can be converted into equivalent string rewrites. So a tree-rewriting system is just a Post system, but that makes it very powerful. Of course, one can combine this capability with other more traditional compiler methods, which is what we do with our product. That makes it more convenient; you don’t have do everything as Post system.

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

Sidebar

Related Questions

There is a question here in stackoverflow with the same title but that is
I know title of my question doesn’t make any sense. So what happened is
There is the same question listed under The key 'UserID' does not exist in
I'm sure this is an extremely obvious question, and that there's a function that
That title is brutal, but I don't know how else to put it. I
I recently asked just about the same question, but this one got a little
I didn't want to make the title too long but this question specifically refers
I'm really sure that the title of my question depicts what i mean.i guess
Excuse me for the non-informative title. Just can't shortly describe what I want within
This question follows another, just solved here Now I want to do a different

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.