Difference between revisions of "Compiler error message"

From Dragon Age Toolset Wiki
Jump to: navigation, search
m (N)
m (Cleaned up existing messages, added some new messages.)
Line 1: Line 1:
 
When the compiler encounters a syntax error it aborts the process for that script and displays a '''compiler error message''' in the [[Log window panel|Log window]].
 
When the compiler encounters a syntax error it aborts the process for that script and displays a '''compiler error message''' in the [[Log window panel|Log window]].
  
There are a couple of guidelines to remember when trying compiler error message
+
There are a couple of guidelines to remember when trying compiler error message:'
* The compiler reports the error when it can no longer make sense of the script: this often occurs on the line ''after'' the line containing the error.
+
* The compiler reports the error when it can no longer make sense of the script: this often occurs on the line '''after'' the line containing the error.
* Several error messages end with "''while compiling <include>.nss''" even though the error is normally in the script being compiled not the included script.
+
* If the script has one or more include files the error may have "'''while compiling <include>.nss'''" appended to it, however the error may be in the script being compiled rather than an include file.
  
  
 
{{TOC}}
 
{{TOC}}
  
<!-- === <span id="A">A</span> === -->
+
=== <span id="A">A</span> ===
 +
;After compound statement at end
 +
:The double quote before the file name is missing from an [[#include]] directive.
 +
 
 
=== <span id="B">B</span> ===
 
=== <span id="B">B</span> ===
; Break outside of loop or case statement (while compiling <include>.nss)
+
; Break outside of loop or case statement
: [explanation]
+
: [explanation].
  
<!-- === <span id="C">C</span> === -->
+
<!--  
<!-- === <span id="D">D</span> === -->
+
=== <span id="C">C</span> === -->  
=== <span id="E">E</span> ===
+
=== <span id="D">D</span> ===
; Equality test has invalid operands (while compiling <include>.nss)
+
;Declaration does not match parameters
: [explanation]
+
: The wrong type of argument used when calling a function, e.g. a [[string]] passed into a [[int]] argument.
: The include file is not normally the source of the error.
+
  
<!-- === <span id="F">F</span> === -->
+
;Declaration does not match parameters (<function>)
<!-- === <span id="G">G</span> === -->
+
: Too few or too many arguments used when calling a function.
<!-- === <span id="H">H</span> === -->
+
 
<!-- === <span id="I">I</span> === -->
+
=== <span id="E">E</span> ===
<!-- === <span id="J">J</span> === -->
+
; Equality test has invalid operands
<!-- === <span id="K">K</span> === -->
+
: [explanation].
<!-- === <span id="L">L</span> === -->
+
<!--  
<!-- === <span id="K">K</span> === -->
+
=== <span id="F">F</span> === --><!--  
<!-- === <span id="K">K</span> === -->
+
=== <span id="G">G</span> === --><!--  
 +
=== <span id="H">H</span> === -->
 +
=== <span id="I">I</span> ===
 +
;Included file not found
 +
# An include file does not exist or has not been saved.
 +
# The wrong file name used or the ".nss" extension included in an [[#include]] directive.
 +
: NOTE: include files cannot not be compiled (attempting to do so will generate a [[#S|Script must contain either a main or StartingConditional]] error).
 +
<!--  
 +
=== <span id="J">J</span> === --><!--  
 +
=== <span id="K">K</span> === --><!--  
 +
=== <span id="L">L</span> === --><!--  
 +
=== <span id="K">K</span> === --><!--  
 +
=== <span id="K">K</span> === -->
 
=== <span id="M">M</span> ===
 
=== <span id="M">M</span> ===
; Mismatched types (while compiling <include>.nss)
+
; Mismatched types
# The return type not matching function
+
# A value or variable is assigned to a variable of a different type, e.g. a [[string]] value assigned to an [[int]] varaible.
# A void function has been assigned to a variable, for example void function assigned to variable, string function assigned to int variable
+
# A function is assigned to a variable of a different type, e.g. a [[string] function to  assigned to an [[int]] variable.
: The include file is not normally the source of the error.
+
# A function returns a different type from its declared return type.
 +
# A [[void]] function is assigned to a variable.
  
 
=== <span id="N">N</span> ===
 
=== <span id="N">N</span> ===
 
; No colon after case label  
 
; No colon after case label  
: [explanation]
+
: [explanation].
  
 
; No left bracket on arg list
 
; No left bracket on arg list
: [explanation]
+
# The brackets were omitted when calling a function (without arguments).
  
 
; No semicolon after expression
 
; No semicolon after expression
# The semi-colon is missing from the end of an expression
+
# The statement terminator (;) is missing from the end of an expression.
# The expression contains a typo in a keyword
+
# A keyword in an expression contains a typo.
  
; Not all control paths return a value (while compiling <include>.nss)
+
; Not all control paths return a value
 
# A function does not have a return statement.
 
# A function does not have a return statement.
# One or more of logic branches in a function does not have a return statement.
+
# A logic branch in a function does not have a return statement.
 
# A function does not have an else or default case with a return function.
 
# A function does not have an else or default case with a return function.
: The include file is not normally the source of the error.
+
<!--  
 
+
=== <span id="O">O</span> === -->
<!-- === <span id="O">O</span> === -->
+
 
+
 
=== <span id="P">P</span> ===
 
=== <span id="P">P</span> ===
 
; Parsing variable list  
 
; Parsing variable list  
: The statement terminator (;) is missing from the on previous line
+
# The statement terminator (;) is missing from the on previous line.
 
+
# A line contains a rogue double-quotes mark.
<!-- === <span id="Q">Q</span> === -->
+
<!--  
<!-- === <span id="R">R</span> === -->
+
=== <span id="Q">Q</span> === --><!--  
<!-- === <span id="S">S</span> === -->
+
=== <span id="R">R</span> === --><!--  
<!-- === <span id="T">T</span> === -->
+
=== <span id="S">S</span> ===
 +
;Script must contain either a main or StartingConditional
 +
# Compiled an include file directly (instead of the script including it).
 +
# Used the incorrect case i.e. Main instead of main.
 +
<!--
 +
=== <span id="T">T</span> === -->
 
=== <span id="U">U</span> ===
 
=== <span id="U">U</span> ===
 
; Undefined identifier (<identifier>)  
 
; Undefined identifier (<identifier>)  
# A variable is being used before it is defined
+
# A variable is being used before it is defined.
# A string is missing its opening double-quotes mark  
+
# A string is missing its opening double-quotes mark.
 +
 
 +
;Undefined structure
 +
: A [[Struct keyword|structure]] is being used before it is defined.
 +
 
 +
;Unknown state in compiler
 +
: Invalid syntax e.g. an extra comma in a list of arguments.
  
 
; Unterminated string constant  
 
; Unterminated string constant  
# A string is missing its closing double-quotes mark  
+
# A string is missing its closing double-quotes mark.
# A line contains a rouge double-quotes mark
+
# A line contains a rogue double-quotes mark.
  
 
=== <span id="V">V</span> ===
 
=== <span id="V">V</span> ===
; Variable defined without type (while compiling <include>.nss)
+
; Variable defined without type
: [explanation]
+
# A value is being assigned to a variable before it has been declared.
: The include file is not normally the source of the error.
+
# A variable is being assigned or passed into a function before it has been declared.
 
+
<!--  
<!-- === <span id="W">W</span> === -->
+
=== <span id="W">W</span> === --><!--  
<!-- === <span id="X">X</span> === -->
+
=== <span id="X">X</span> === --><!--  
<!-- === <span id="Y">Y</span> === -->
+
=== <span id="Y">Y</span> === --><!--  
<!-- === <span id="Z">Z</span> === -->
+
=== <span id="Z">Z</span> === -->

Revision as of 02:42, 13 April 2020

When the compiler encounters a syntax error it aborts the process for that script and displays a compiler error message in the Log window.

There are a couple of guidelines to remember when trying compiler error message:'

  • The compiler reports the error when it can no longer make sense of the script: this often occurs on the line 'after the line containing the error.
  • If the script has one or more include files the error may have "while compiling <include>.nss" appended to it, however the error may be in the script being compiled rather than an include file.


Contents
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

A

After compound statement at end
The double quote before the file name is missing from an #include directive.

B

Break outside of loop or case statement
[explanation].

D

Declaration does not match parameters
The wrong type of argument used when calling a function, e.g. a string passed into a int argument.
Declaration does not match parameters (<function>)
Too few or too many arguments used when calling a function.

E

Equality test has invalid operands
[explanation].

I

Included file not found
  1. An include file does not exist or has not been saved.
  2. The wrong file name used or the ".nss" extension included in an #include directive.
NOTE: include files cannot not be compiled (attempting to do so will generate a Script must contain either a main or StartingConditional error).

M

Mismatched types
  1. A value or variable is assigned to a variable of a different type, e.g. a string value assigned to an int varaible.
  2. A function is assigned to a variable of a different type, e.g. a [[string] function to assigned to an int variable.
  3. A function returns a different type from its declared return type.
  4. A void function is assigned to a variable.

N

No colon after case label
[explanation].
No left bracket on arg list
  1. The brackets were omitted when calling a function (without arguments).
No semicolon after expression
  1. The statement terminator (;) is missing from the end of an expression.
  2. A keyword in an expression contains a typo.
Not all control paths return a value
  1. A function does not have a return statement.
  2. A logic branch in a function does not have a return statement.
  3. A function does not have an else or default case with a return function.

P

Parsing variable list
  1. The statement terminator (;) is missing from the on previous line.
  2. A line contains a rogue double-quotes mark.

U

Undefined identifier (<identifier>)
  1. A variable is being used before it is defined.
  2. A string is missing its opening double-quotes mark.
Undefined structure
A structure is being used before it is defined.
Unknown state in compiler
Invalid syntax e.g. an extra comma in a list of arguments.
Unterminated string constant
  1. A string is missing its closing double-quotes mark.
  2. A line contains a rogue double-quotes mark.

V

Variable defined without type
  1. A value is being assigned to a variable before it has been declared.
  2. A variable is being assigned or passed into a function before it has been declared.