1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

C# readonly is java final for member variables (Java allows to assign in constructor too)

This commit is contained in:
Kevin Glynn 2012-09-03 17:46:11 +02:00
parent 4d78138a2a
commit e7a8fe4efe

View File

@ -758,7 +758,7 @@ modifiers returns [List<string> modList]
(modifier { if ($modifier.tree != null) $modList.Add( $modifier.tree.Text); })+ ; (modifier { if ($modifier.tree != null) $modList.Add( $modifier.tree.Text); })+ ;
modifier: modifier:
'new' -> /* No new in Java*/ | 'public' | 'protected' | 'private' | i='internal' -> PUBLIC[$i.token, "public"] /* translate to public .... */| 'unsafe' -> | 'abstract' | s='sealed' -> FINAL[$s.token, "final"] | 'static' 'new' -> /* No new in Java*/ | 'public' | 'protected' | 'private' | i='internal' -> PUBLIC[$i.token, "public"] /* translate to public .... */| 'unsafe' -> | 'abstract' | s='sealed' -> FINAL[$s.token, "final"] | 'static'
| 'readonly' -> /* no equivalent in C# (this is like a const that can be initialized separately in the constructor) */ | 'volatile' | e='extern' { Warning($e.line, "[UNSUPPORTED] 'extern' modifier"); } | 'virtual' -> | 'override' -> /* not in Java, maybe convert to override annotation */; | r='readonly' -> FINAL[$r.token, "final"] | 'volatile' | e='extern' { Warning($e.line, "[UNSUPPORTED] 'extern' modifier"); } | 'virtual' -> | 'override' -> /* not in Java, maybe convert to override annotation */;
class_member_declaration class_member_declaration
@init { @init {