Different between syntax error and parse error - syntax-error

I am wondering that is there any different between parse error and syntax error ? if so can anyone please tell me what is the different ?
thanks

The way I understand it is that a parse error happens because of a syntax error. You (the developer) write code that contains a 'syntax error'. When that code is compiled, the compiler tries to parse your code but cannot which results in a parse error.
If you are dealing with an interpreted language, (PHP, ASP, etc.) the parse error happens when the code is run because it is compiled and run at the same time.

Related

Compiling KratosMultiphysics with All Applications get errors

I am compiling Kratos with this standard-configure.sh that I modify:
standard-configure.sh
But I get error and I can't compile Trilinos maybe I wrongly put the TRILINOS_ROOT.
If anyone can point me which place should I place TRILINOS_ROOT and METIS_INCLUDE_DIR as well.
Not only that, there are other errors when compiling (see attachment below), how to get pass this?

Is there a function or crate to display errors with line and column numbers, help text, and highlighting?

Rust has very clear error display, showing the line and part of line where an error occurred:
Is there a function from the Rust standard library or crate which replicates this for an arbitrary error? I'm kind of assuming it must exist somewhere within the Rust codebase, but can't find anything (mostly because any search term like "Rust rich line errors..." returns errors people have got while writing Rust, not how to generate the error display :-)).
E.g. I have the line number and character number of an error as well as the source, is an existing implementation of the above pretty error which I can reuse?
I don't know if this is of much help, but the rustc compiler uses the rustc_errors crate to generate these messages. I found this by looking at the README in librustc and searching the guide book for "message".
The search brought me to this section in the guide which covers error messages.

Error during compilation of sql embedded in a COBOL program

I have trying to insert user-inputted data into a table "C01371" using COBOL and SQL in a mainframe server. I am getting an error of "Unused or undeclared host variable 'quantity'" despite the fact that I already declared it and used it too. I tried to learn more about the host variables and embedded SQL programs in cobol. But so far I couldn't find a solution. Please help me rectify my error. Thanking You all.
Declaration:
Cobol Code:
Error during compilation:

VBA Access Error displayed but nothing in the code

It's my first time using VBA and Access even if I'm coming from Angular and Swift, I'm completely lost.
I'm modifying an existing project and I have created a text label and used the expression generator, then the application crashed. I obviously think that there is a problem in the "expression" that I generated.
The problem is now that I cannot access to the Form where I was working and I get this message :
I have tried to go to the code but I haven't found my problematic expression. Do access store somewhere else the code generated, especially for the expressions generated? How can I find again my problematic expression?
In the code I found, I didn't find any object declaration, for example, as a TextBox...I tried to compile all code, since this is a syntax error, it should be easier to find and solve but it didn't work at all, the compile and run didn't show me any syntax error, I tried to change some settings to handling error but no success...
So if someone could tell me how to solve this problem. Thanks in advance.

Antlr generates broken C# code, missing variable name in declaration

I have an grammar for a template language.
I created this for Antlr 3.2 and CSharp2 target and have it working.
Now I try to change to antlr 3.4 and CSharp3 target (have tried CSharp2 also) and I get a strange error in the Parser in a synpred function.
Several variable declarations are missing the variable name:
IToken = default(IToken)
Some also have th wrong type
void = default(void);
should be
AstParserRuleReturnScope<CommonTree, IToken> = default(AstParserRuleReturnScope<CommonTree, IToken>);
Have any one seen this before and what could be causing this.
The grammar is the same that was working before.
Unfortunately I cannot share the grammar and I have not had time to create a test grammar that causes the same error.
I can of course fix the errors manually and the code works but it's a bit tiresome to have to go through the code after generation fixing them.
I was able to resolve this problem by using the native .NET version of the ANTLR code generation tool (Antlr3.exe) instead of the Java version. Specifically, antlr-dotnet-tool-3.4.1.9004.7z worked for me, whereas antlr-3.4-complete-no-antlrv2.jar did not.