[SOLVED] "NullPointerException (..) missing value converter" [message #1734531] |
Thu, 09 June 2016 08:35  |
Eclipse User |
|
|
|
Hi again,
I got an error message within the generated editor:
"A NullPointerException occured. This indicates a missing value converter or a bug in its implementation."
I tried to reproduce the issue with a part of my grammar.
In this case the following should be possible:
// [1] appending of array-like structs and variables or values
// Rule: Vector_constr
[a] .. [ ] .. [42] .. b .. 23
// [2] variable declaration like normal arrays with square brackets after the type
// Rule: Var >> Type
var int[a] x
var int[2] y
var int[ ] z
But the above-mentioned error occurs when:
- in [1]: I type something without square brackets like ".. b .."
- in [2]: If I type something between the square brackets. If the square brackets are empty no error occurs..
I really got no idea what the meaning of the error is or what I can do to fix this ..
Someone can help?
Here is the grammar for this:
Note: It works with backtrack=true!
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Block:
stmt+=Stmt*;
Stmt:
Var | Exp
;
Var:
'var' type=Type name=ID_VAR
;
Type:
(
type_prim=Types
| type_cls_adt=ID_CLS_ADT
| type_nat=ID_NAT
)
('&' | '&&' | '?' | '[' (exp+=Exp)? ']')*
;
ExpList:
{ExpList} ( exp+=Exp (',' exp+=Exp)* )?
;
Vector_tup:
'[' e=ExpList ']'
;
Vector_constr:
(vec+=Vector_tup) ('..' (vec+=Vector_tup | exp+=Exp) )*
;
//------------- Expression -----------------
Exp:
Exp0
;
Exp0:
Exp1
;
Exp1:
left=Exp2 ('or' right+=Exp2)*
;
Exp2:
left=Exp3 ('and' right+=Exp3)*
;
Exp3:
left=Exp4 ( ( '!=' | '==' | '<=' | '>=' | '<' | '>' ) right+=Exp4)*
;
Exp4:
left=Exp5 ('|' right+=Exp5)*
;
Exp5:
left=Exp6 ('^' right+=Exp6)*
;
Exp6:
left=Exp7 ('&' right+=Exp7)*
;
Exp7:
left=Exp8 ( ('>>' | '<<') right+=Exp8)*
;
Exp8:
left=Exp9 ( ('+'|'-') right+=Exp9)*
;
Exp9:
left=Exp10 ( ( ('*' | '/') | '%') right+=Exp10)*
;
Exp10:
('not' | '-' | '+' | '~' | '*' | '&&' | '&' | '$$' | '$' | '(' cast+=Cast ')')*
expr=Exp11
;
Exp11:
left=Exp12
(
(
'()' |
'(' expList+=ExpList ')'
('finalize' 'with' finally+=Finally 'end' )?
)
| '[' exp+=Exp ']'
| (':' | '.') field+=(ID_VAR | ID_NAT | ID_CLS_ADT)
| '?'
| '!'
)*
;
Exp12:
Prim
;
Prim:
'(' exp=Exp ')'
| Sizeof
| var=ID_VAR | nat=ID_NAT | def=ID_EXT_TAG
| Null | Number | {String} STRING
| Global | This | Outer | =>Vector_constr
| 'call' Exp
| 'call/rec' Exp
;
Cast:
type=Type | cast=('@nohold' | '@plain' | '@pure')
;
Sizeof:
'sizeof' '(' (Type | Exp) ')'
;
Null:
{Null} 'null'
;
Number:
{Number} ( =>(INT ('.' INT)?) | HEX | 'true' | 'false' )
;
Global:
{Global} 'global'
;
This:
{This} 'this'
;
Outer:
{Outer} 'outer'
;
Types:
name=(
'bool' | 'byte' | 'char' | 'f32' | 'f64'
| 'float' | 'int' | 's16' | 's32' | 's64'
| 's8' | 'u16' | 'u32' | 'u64' | 'u8'
| 'uint' | 'void' | 'word'
)
;
Finally:
Block
;
//------------- ID_RULES -----------------
terminal ID_VAR:
(('a'..'z') ('a'..'z' | 'A'..'Z' | '0'..'9' | '_')*) | '_'
;
terminal ID_EXT_TAG:
('A'..'Z') ('A'..'Z' | '0'..'9' | '_')*
;
terminal ID_CLS_ADT:
('A'..'Z') ('a'..'z' | 'A'..'Z' | '0'..'9' | '_')*
;
terminal ID_NAT:
'_' ('a'..'z' | 'A'..'Z' | '0'..'9' | '_')+
;
terminal HEX: //Used in Rule: Number
('0' ('x'|'X') ('0'..'9'|'A'..'F'|'a'..'f')*)
;
[Updated on: Thu, 09 June 2016 09:44] by Moderator Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03602 seconds