Line by line parsing of the statements written in an editor of an IDE

radha gogia

radha gogia

@radha-BTDzli Oct 26, 2024
I just wanted to ask that during our typing on the editor of any IDE ,we are always prompted for errors whenever we try to make some syntactical mistakes or any mistakes like reassigning a value to a final variable,or making the local variable static,so actually how does it all happens because all this is the work of compiler and during just writing the program on the editor,how does a particular IDE is able to manage this stuff,is it that during typing only,some interpreter works for whom similar parse tables are made as for the complier.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • rahul69

    rahul69

    @rahul69-97fAOs Dec 5, 2014

    radha gogia
    I just wanted to ask that during our typing on the editor of any IDE ,we are always prompted for errors whenever we try to make some syntactical mistakes ..... how does a particular IDE is able to manage this stuff,is it that during typing only,some interpreter works for whom similar parse tables are made as for the complier.
    Actual process may differ for different IDE's but basic idea is the following.
    When we write code in IDE, it starts building a parse tree, and if it broken, it may flash
    error (by making color red etc.) However, this checking may not be exhaustive like that of compiler and so we need compiler to check it (eg in case of some semantic errors).
    Similar approach is used in auto-complete option of IDE's.
  • radha gogia

    radha gogia

    @radha-BTDzli Dec 5, 2014

    rahul69
    Actual process may differ for different IDE's but basic idea is the following.
    When we write code in IDE, it starts building a parse tree, and if it broken, it may flash
    error (by making color red etc.) However, this checking may not be exhaustive like that of compiler and so we need compiler to check it (eg in case of some semantic errors).
    Similar approach is used in auto-complete option of IDE's.
    I just wanted to know that if the lexical analyser or parser would generate the parse trees then is it so that they have the information of keywords which the compiler has because the IDE's usually tend to display the error when we try to write any invalid keyword and also then there must be some means by which actually they tend to even prompt for error messages like return statement not found.