Skip to main content

Nested comments are mean extra work for the parser. Usually when you see the start of a comment you ignore everything until the end comment marker. IIn order to support nested comments you have to parse the text in the comments as well. The biggest issue, though, is that a programmer has to be careful to close all nested comments correctly or it will lead to compilation errors. Correctly implementing a compiler is something that can be done but keeping track of nested comments as a programmer is quite error prone-prone and irritating.

Nested comments are mean extra work for the parser. Usually when you see the start of a comment you ignore everything until the end comment marker. I order to support nested comments you have to parse the text in the comments as well. The biggest issue though is that a programmer has to be careful to close all nested comments correctly or it will lead to compilation errors. Correctly implementing a compiler is something that can be done but keeping track of nested comments as a programmer is quite error prone and irritating.

Nested comments mean extra work for the parser. Usually when you see the start of a comment you ignore everything until the end comment marker. In order to support nested comments you have to parse the text in the comments as well. The biggest issue, though, is that a programmer has to be careful to close all nested comments correctly or it will lead to compilation errors. Correctly implementing a compiler is something that can be done but keeping track of nested comments as a programmer is quite error-prone and irritating.

Source Link
Gus
  • 368
  • 1
  • 4

Nested comments are mean extra work for the parser. Usually when you see the start of a comment you ignore everything until the end comment marker. I order to support nested comments you have to parse the text in the comments as well. The biggest issue though is that a programmer has to be careful to close all nested comments correctly or it will lead to compilation errors. Correctly implementing a compiler is something that can be done but keeping track of nested comments as a programmer is quite error prone and irritating.