You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When importing my own syntax definition of a language in a compiled Rascal console, then I'm getting the following error:
Error: Field chars already defined as type [34-34]+ on non-terminal type StringConstant, cannot redefine to type MyStringChars? AT |std:///lang/rascal/syntax/Rascal.rsc|(14583,14,<374,8>,<374,22>)
Both my own syntax definition and also the Rascal grammar contain a lexical named StringConstant with a field chars, however it remains unclear to me why the compiler associated my syntax definition's lexical, with the Rascal'l lexical (neither Rascal grammar nor any other module is imported):
What if I indeed would like to include two grammars that have the same names for productions or lexicals (e.g., if I'd like to transform from one language to another)?
I'd assume that names like StringConstant or IntegerLiteral are common in grammars.
That is possible, but mixing them in the same file is a bit painful, as grammars are merged differently than the import works for other stuff. I think @tvdstorm has most experience with that.
When importing my own syntax definition of a language in a compiled Rascal console, then I'm getting the following error:
Error: Field chars already defined as type [34-34]+ on non-terminal type StringConstant, cannot redefine to type MyStringChars? AT |std:///lang/rascal/syntax/Rascal.rsc|(14583,14,<374,8>,<374,22>)
Both my own syntax definition and also the Rascal grammar contain a lexical named
StringConstant
with a fieldchars
, however it remains unclear to me why the compiler associated my syntax definition's lexical, with the Rascal'l lexical (neither Rascal grammar nor any other module is imported):The text was updated successfully, but these errors were encountered: