• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "Decoder.hpp"
7 
8 namespace asr
9 {
10 
Decoder(std::map<int,std::string> & labels)11 Decoder::Decoder(std::map<int, std::string>& labels) :
12             m_labels(labels) {}
13 
FilterCharacters(std::vector<char> & unfiltered)14 std::string Decoder::FilterCharacters(std::vector<char>& unfiltered)
15 {
16     std::string filtered;
17 
18     for (int i = 0; i < unfiltered.size(); ++i)
19     {
20         if (unfiltered.at(i) == '$')
21         {
22             continue;
23         }
24         else if (i + 1 < unfiltered.size() && unfiltered.at(i) == unfiltered.at(i + 1))
25         {
26             continue;
27         }
28         else
29         {
30             filtered += unfiltered.at(i);
31         }
32     }
33     return filtered;
34 }
35 } // namespace asr
36 
37