???????

Started by
1 comment, last by im new so help 22 years, 4 months ago
Whats a parse error and how do i fix it?
Advertisement
A parse error it''s when you foret a '' ; '' in the end of an instruction...so you just have to place the '';'' where you forget it.
quote:Original post by Major
A parse error it's when you foret a ' ; ' in the end of an instruction...so you just have to place the ';' where you forget it.

Not exactly (though you describe one kind of parse error).

A parse error occurs when the succession of tokens does not comply with the expected language syntax. Sound complicated? It's not. Every unique identifier (a, x, myvar, str, etc), operator (+, -, %, [], (), +=, --, /, etc) or keyword (int, long, bool, this, const, static, operator, etc) is regarded as a token by a compiler (my examples are from C/C++; the actual tokens will differ per language). The language specifies an expected syntax that must be followed, along the lines of
statement statement-terminator    A statement may consist of  keyword-declarator identifier     {assignment-operator initializer-value    };  (entities within {} pairs are optional)...  

and so forth. This defines what the compiler expects on a per-line basis, within parentheses (depending on what keyword/identifier preceded it) and so on. If it does not encounter one of the expected/permitted entities, it signals a parse error.

In other words, a parse error means that you either left something out or you added something that should be there. Occasionally it may be more complicated than that, but that's generally the synopsis.

Oh, and write a topic next time. Be courteous to the people on this forum and help them to help you. Many people who could have answered your question fully may not have sincce you wrote "???????", and if every newbie writes that, then how do we know what is what?

Good luck.

[Edit:] Pre-formatted line termination.

Edited by - Oluseyi on November 18, 2001 3:01:28 PM

This topic is closed to new replies.

Advertisement