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

remove QID token, so that cs.g stays close to upstream

This commit is contained in:
Kevin Glynn 2010-11-06 15:15:24 +01:00
parent 690a5af383
commit e4bd86900b
2 changed files with 6 additions and 12 deletions

View File

@ -115,10 +115,10 @@ scope NSContext;
} }
: :
'namespace' qi=qualified_identifier 'namespace' qi=qualified_identifier
{ Debug("namespace: " + $qi.text); { Debug("namespace: " + $qi.thetext);
$NSContext::nss.Add(new UseRepTemplate($qi.text)); $NSContext::nss.Add(new UseRepTemplate($qi.thetext));
// extend parent namespace // extend parent namespace
$NSContext::currentNS = this.ParentNameSpace + $qi.text; $NSContext::currentNS = this.ParentNameSpace + $qi.thetext;
} }
namespace_block ';'? ; namespace_block ';'? ;
namespace_block: namespace_block:
@ -157,8 +157,8 @@ type_declaration:
| enum_declaration | enum_declaration
| delegate_declaration ; | delegate_declaration ;
// Identifiers // Identifiers
qualified_identifier: qualified_identifier returns [string thetext]:
^(QID identifier+) ; i1=identifier { $thetext = $i1.text; } ('.' ip=identifier { $thetext += "." + $ip.text; } )*;
namespace_name namespace_name
: namespace_or_type_name ; : namespace_or_type_name ;

View File

@ -6,11 +6,6 @@ options {
language=CSharp2; language=CSharp2;
} }
tokens {
QID;
}
@namespace { RusticiSoftware.Translator.CSharp } @namespace { RusticiSoftware.Translator.CSharp }
@lexer::header @lexer::header
@ -74,8 +69,7 @@ type_declaration:
| delegate_declaration ; | delegate_declaration ;
// Identifiers // Identifiers
qualified_identifier: qualified_identifier:
identifier ('.' identifier)* identifier ('.' identifier)*;
-> ^(QID identifier+) ;
namespace_name namespace_name
: namespace_or_type_name ; : namespace_or_type_name ;