static void RenameConflict(ParseNode node, Dictionary<string, string> renameTable)
 {
     var tokenData = node.GetTokenData();
     var tokenContent = tokenData.Content;
     if (!renameTable.ContainsKey(tokenContent))
         return;
     var parentNodeStates = node.Parent.States;
     var indexInParent = parentNodeStates.MappedNodes.IndexOf(node);
     var nextTokenKind = parentNodeStates.MappedNodes[indexInParent + 1].GetTokenKind();
     if (nextTokenKind == TokenKind.OpenParen)
     {
         node.GetTokenData().Content = renameTable[tokenContent];
     }
 }
Beispiel #2
0
 protected override void FixLogic(ParseNode node)
 {
     var tokenContent = node.GetTokenData();
     var content = tokenContent.Content
         .Replace('$', '_')
         .Replace('.', '_')
         ;
     tokenContent.Content = content;
 }
Beispiel #3
0
 void OnIdentifier(ParseNode node)
 {
     var tokenData = node.GetTokenData();
     var content = tokenData.Content;
     string newContent;
     if (!DeclarationName.TryGetValue(content, out newContent))
         return;
     tokenData.Content = newContent;
 }
 protected override void FixLogic(ParseNode node)
 {
     var tokenContent = node.GetTokenData();
     string replaceWord;
     if (WordsMapping.TryGetValue(tokenContent.Content, out replaceWord))
     {
         tokenContent.Content = replaceWord;
     }
 
 }
 static void EvaluateConflict(ParseNode node, Dictionary<string, bool> functionsWithConflicts)
 {
     var tokenData = node.GetTokenData();
     var tokenContent = tokenData.Content;
     if (!functionsWithConflicts.ContainsKey(tokenContent))
         return;
     var parentNodeStates = node.Parent.States;
     var indexInParent = parentNodeStates.MappedNodes.IndexOf(node);
     var tokenKind = parentNodeStates.MappedNodes[indexInParent + 1].GetTokenKind();
     if (tokenKind == TokenKind.OpenParen)
         return;
     functionsWithConflicts[tokenContent] = true;
 }