diff --git a/bin/gen/Release/Coati_keygen b/bin/gen/Release/Coati_keygen deleted file mode 100755 index 1b1e2234..00000000 Binary files a/bin/gen/Release/Coati_keygen and /dev/null differ diff --git a/bin/gen/Release/license.txt b/bin/gen/Release/license.txt deleted file mode 100644 index 586fb54f..00000000 --- a/bin/gen/Release/license.txt +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN LICENSE----- -asdf;lkjas;ldkfj;alsdkfj;alskdfasdflkjlksjlkdfasdfoiupqwernkljoviopizpoxcuivojqwoenr;soidfooiaupoiay -Single User License -Coati 0 -$9$AQAKZ6/FMxHq850YPk5GfWSYRWZv+x1mgB5B6/OPz7D7mOfCvowH -hctPm+tJfoiFhSamiyBuTe4jbtIvvyZShK1B1OKfG1C+lOboSZh2HJn -6cBdiKE6ZfrymDngPUE23lm/JPIJwlZjvPTcd/N3YusUs0aqiTEXfHu -G/c34NYI5AIbute6xQjY6Q0cLdZcOHqSBfGxZrZTl9q6yVcM6B2mwDE -YsFzrOmXsIyYLX4+lf0eEFl5Dmw437IZN8z5yZFOZ3xp91Mpz6nMU79 -9X6ATP6RRVC58zYYznasbvqgz1xoOIivYZr6WG/+3ia4/A5Zn9r+Mt9 -5AjHqWOZtMqQAHqeHgOzsKHqbu0xduH8HsPXBF8fPD6EnLVz6GbjBET -KuDWka14AHzA== ------END LICENSE----- diff --git a/bin/gen/Release/private-0.pem b/bin/gen/Release/private-0.pem deleted file mode 100644 index 8aa49ba5..00000000 --- a/bin/gen/Release/private-0.pem +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIIFNTBfBgkqhkiG9w0BBQ0wUjAxBgkqhkiG9w0BBQwwJAQMDAB5IuntKywoJmry -AgMDDUACASAwDAYIKoZIhvcNAgkFADAdBglghkgBZQMEASoEEA7JwOuCMu6xUJ+c -0NBKZZsEggTQC82I8AHltLbPCAIkTZoJv68aOV/cVXDcxZ7Mn1hOiob7nO4RuteW -mwTX3JZFd7Jlw5h706xAdRjbSsJXGgTMXECciqrfZ9c21+tYbKV4JpPBQMEhTLpa -IXUTWonQ9wh7vis3bcwBPaRCsfDtYaz872vDpf1X5BVOppoffKCiKFi2y5C+e3HG -CPcg+BTgZg+SRJB9yvSDqdDO5/s9Y6+otePt4Gr+wSOJRwYkdZ67f9uq4BaFcw2z -wIRKA0C1oClu7TAo5onjv1rvw/66migcMHRw1zjIk6oQv44caJvqca1eM9dniZo7 -ccbq11PWpeBdKvEkAWuW1PoI7uuLQNdzs3UDO7LJttWwVNAKtO3o8LOL8x9Q7Jns -tvQqUrf0VNB8eBfmsD2I3zVMu2X4rNEDYlAbrL3f1vNkt949ib4eG7+lo3wrCt6J -6UFA791HGVJUvFI0NHdtT32+LdKyTJ+bIlz663LkNU2+mBs6UL7qe6XIBoXCNcg8 -+VDKDDVSIyckSVxV7WuGeX9n3igRuvt88T2pCVlY+HEBWDgFoXxc5vx8LdD9EVaQ -OAmuXABLNTqUTCGms9KAa3WJ/QW6++NAt4uf+37LKzM9zyUrDZMTs5M2ZJ/otwgK -ZqIbDcVyfsX79ATs0UeJ7bdrMduXuKhFIVsjlJCGXlyKa7h+JmEpPkqnELGiThvi -hvWogpYt6S6/ofw13MAAgkDqgsfhUGH8tmPu8ufYQn2QQTjB7y1X+s+DUPBUYlic -Ds29YvGMp3wesMFppfwygtGtBFxxs7zvuz3aq9Putu1xC9q3dtHOPdxZYyLvz/aJ -F6BfOqk3NP0a6/S9TphgxE9CqYz2RIqRQg91IbPPrEiC8Sm3fLgX0fO1kfVN7x0E -Pg5+3M56UVflcWLsIcjDVYK4EId4XLHBTjFn8xhkEj56UJQsjb9fFbdQQBBI5pWM -G2nxoGdHD/GCOjZi2f393OMIDFbfoIaoz4L4osIFYaIg4sMrIy2oUOEwnqyLEVf2 -tQ58ysC7SDVZza4jai5QXuTCHyMcHYf9BxuzIHEViquI0y19QvlMW17effUctfow -8a0sqCYr0KczggsaOR9BdAgHpSeoCM7SxkQd+j55iX/w7Det8JUvHoCSHRPwM0ar -QiAncEtdKYyU/vz25feTh/crDH1OB4umZIatPVJFr7samb1McocSI5/AxQ5YSkRT -BYyFj6Yi5D0jgmob4+t96Ub0UnWinXk+V6CeTEzgSE6/FYlEb+PqibWAhDfEWG+7 -0oG58ajt2vOzbGytDE9RV48HzLoUoWEaNDoa51viuJhpSmRii4CrBj+ENvber2GR -qOM7bMcmicqUvegN9cB+9ZiIzWVePVvI/1NRvypqjXJVE99AD3GyRd5fuC0Vo4VQ -xdaZuk6ysWBldUcFVUCDzr32FWaxKe6cGZbjRtS/u6rDJ8DEJzvm7FcgcLj80qrd -mGrAMUafAfe+FrHSiMits/pUjzwiZqjsQeVIlULUgxQGeLVoERV7InkooBqxVOpI -R63O9zMjEZgkf7yhD8nOrw1fLO08D/eOud2yL5EhXUMWQmjnmBYDog/M1IRu13ba -L4qeddYh0cgHID8DjhjaY+g8VKiikgRO0d59xAkzHrMk4MS1l27xOz8= ------END ENCRYPTED PRIVATE KEY----- diff --git a/bin/gen/Release/public-0.pem b/bin/gen/Release/public-0.pem deleted file mode 100644 index c22aa858..00000000 --- a/bin/gen/Release/public-0.pem +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsop6ceQNJeWYjourIu2Z -QydUFJwm3kwqXvoAiYP+NeLEyR9OET0eBRwowKDbFzdfDyCXcfJAbsRBoQ1he8Bw -dXcGZqs+QNcnoBz0Vl/uaxOXpVSN5RYj6wo0IFQ/nrR+gMTmzHut8ohtXI4n4a0C -7OVMfwoR2uJyLMLTQiHekEsLvraMnRcS5FbqIq2yUuVYCfGvU3Y2xo1jsvIkko7W -uF/Lw7LFCeruZ1hRYDLGa/HnKepdLhGXoh7lDQuagsUg510PVRGru4G50ATqKVTa -IwcvWNeF0BWjC78uBIhk5G65ZI/HRsS4MQvu3UwrTvtp6d9tTNOT9wixpfD1UtBr -qwIDAQAB ------END PUBLIC KEY----- diff --git a/bin/test/data/log/test_log.txt b/bin/test/data/log/test_log.txt index a46055eb..a6241478 100644 --- a/bin/test/data/log/test_log.txt +++ b/bin/test/data/log/test_log.txt @@ -1,177 +1,189 @@ -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml +ConfigManager.cpp WARNING: value path/to/nowhere is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:11 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:13 +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:7:15 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:5:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:48 +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:7:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:3:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml Token.cpp ERROR: Location Id was not referenced by this Token. Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class Edge.cpp ERROR: Nodes are not plain copies. @@ -220,10 +232,23 @@ Edge.cpp ERROR: Nodes are not plain copies. NetworkProtocolHelper.cpp ERROR: Failed to parse message, invalid type token NetworkProtocolHelper.cpp ERROR: Failed to parse setActiveToken message, invalid token count Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml +ConfigManager.cpp WARNING: value Bool is not present in config. +ConfigManager.cpp WARNING: value Int is not present in config. +ConfigManager.cpp WARNING: value Float is not present in config. +ConfigManager.cpp WARNING: value String is not present in config. Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml +ConfigManager.cpp WARNING: value Bool is not present in config. +ConfigManager.cpp WARNING: value Int is not present in config. +ConfigManager.cpp WARNING: value Float is not present in config. +ConfigManager.cpp WARNING: value String is not present in config. +ConfigManager.cpp WARNING: value Bool is not present in config. +ConfigManager.cpp WARNING: value Int is not present in config. +ConfigManager.cpp WARNING: value Float is not present in config. +ConfigManager.cpp WARNING: value String is not present in config. +ConfigManager.cpp WARNING: value NewBool is not present in config. INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp - INFO: typedef: type -> int + INFO: typedef: type INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp INFO: class: Class @@ -234,9 +259,6 @@ TextAccess.cpp ERROR: Could not open file file.cpp TextAccess.cpp ERROR: Could not open file file.cpp INFO: global: Global INFO: file: file.cpp < 0:0 0:0> -TextAccess.cpp ERROR: Could not open file file.cpp - INFO: global: Global - INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp INFO: field: m_field INFO: file: file.cpp < 0:0 0:0> @@ -244,13 +266,13 @@ TextAccess.cpp ERROR: Could not open file file.cpp INFO: field: Struct::m_field INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp - INFO: function: isTrue + INFO: function: bool isTrue(char) INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp - INFO: method: isMethod + INFO: method: void isMethod(bool) INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp - INFO: method: Class::isMethod + INFO: method: void Class::isMethod(bool) INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp INFO: namespace: utility @@ -275,34 +297,34 @@ TextAccess.cpp ERROR: Could not open file file.cpp INFO: inheritance: StructB : StructA INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp - INFO: method: A::isMethod - INFO: method: B::isMethod - INFO: override: A::isMethod -> B::isMethod + INFO: method: void A::isMethod(bool) + INFO: method: void B::isMethod(bool) + INFO: override: void A::isMethod(bool) -> void B::isMethod(bool) INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp - INFO: function: isTrue - INFO: function: func - INFO: call: isTrue -> func + INFO: function: bool isTrue(char) + INFO: function: void func(bool) + INFO: call: bool isTrue(char) -> void func(bool) INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp INFO: global: global - INFO: function: isTrue - INFO: call: global -> isTrue + INFO: function: bool isTrue(char) + INFO: call: global -> bool isTrue(char) INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp - INFO: function: isTrue + INFO: function: bool isTrue(char) INFO: field: Foo::m_field - INFO: field usage: isTrue -> Foo::m_field + INFO: field usage: bool isTrue(char) -> Foo::m_field INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp - INFO: function: isTrue + INFO: function: bool isTrue(char) INFO: global: global - INFO: global usage: isTrue -> global + INFO: global usage: bool isTrue(char) -> global INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp - INFO: function: isTrue + INFO: function: Struct isTrue(char) INFO: struct: Struct - INFO: type usage: isTrue -> Struct + INFO: type usage: Struct isTrue(char) -> Struct INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp INFO: file: file.h < 0:0 0:0> @@ -322,3 +344,477 @@ TextAccess.cpp WARNING: Line numbers start with one, is 0 TextAccess.cpp WARNING: Line numbers start with one, is 0 TokenLocationCollection.cpp ERROR: Can't create TokenLocation with wrong boundaries. TokenLocationCollection.cpp ERROR: Can't create TokenLocation with wrong boundaries. +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Program Files (x86)\Visual Leak Detector\include" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\build" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\build\src\lib_gui" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\app" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\trial" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\Qt5.5\5.5\msvc2013\include" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\Qt5.5\5.5\msvc2013\include\QtCore" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\Qt5.5\5.5\msvc2013\include\QtGui" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\Qt5.5\5.5\msvc2013\include\QtNetwork" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\Qt5.5\5.5\msvc2013\include\QtWidgets" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\Qt5.5\5.5\msvc2013\mkspecs\win32-msvc2013" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\boost_1_59_0" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\clang-11vm\build\include" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\clang-11vm\build\tools\clang\include" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\clang-11vm\llvm\include" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\clang-11vm\llvm\tools\clang\include" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\cxxtest-4.3" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\gameDevResources\eigen" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\projekte\code\2014_master_project\masterproject\bin\test\data/vsSolutionParserTestSuite/..\src\lib\utility\solution\SolutionParserCMake.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "D:\projekte\code\2014_master_project\masterproject\bin\test\data/vsSolutionParserTestSuite/..\src\lib\utility\solution\SolutionParserCMake.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\build\Coati.rc" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\build\Coati_lib_gui_automoc.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\build\src\lib_gui\version.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\build\test_main.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\app\data\parser\cxx\TaskParseCxx.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\app\isTrial.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\app\main.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external\sqlite\CppSQLite3.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external\sqlite\CppSQLite3.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external\sqlite\sqlite3.c" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external\sqlite\sqlite3.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external\tinyxml\tinystr.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external\tinyxml\tinystr.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external\tinyxml\tinyxml.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external\tinyxml\tinyxml.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external\tinyxml\tinyxmlerror.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\external\tinyxml\tinyxmlparser.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\Application.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\Application.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\Project.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\Project.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\Component.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\Component.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\ComponentFactory.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\ComponentFactory.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\ComponentManager.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\ComponentManager.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\CodeController.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\CodeController.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\Controller.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\Controller.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\FeatureController.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\FeatureController.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\GraphController.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\GraphController.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\IDECommunicationController.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\IDECommunicationController.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\NetworkFactory.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\NetworkFactory.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\RefreshController.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\RefreshController.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\SearchController.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\SearchController.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\StatusBarController.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\StatusBarController.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\UndoRedoController.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\UndoRedoController.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\ActivationTranslator.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\ActivationTranslator.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\BucketGrid.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\BucketGrid.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\DummyEdge.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\DummyNode.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\GraphLayouter.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\GraphLayouter.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\GraphPostprocessor.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\GraphPostprocessor.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\NetworkProtocolHelper.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\NetworkProtocolHelper.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\SnippetMerger.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\controller\helper\SnippetMerger.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\CodeView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\CodeView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\CompositeView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\CompositeView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\GraphView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\GraphView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\GraphViewStyle.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\GraphViewStyle.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\GraphViewStyleImpl.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\MainView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\MainView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\RefreshView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\RefreshView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\SearchView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\SearchView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\StatusBarView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\StatusBarView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\UndoRedoView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\UndoRedoView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\View.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\View.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\ViewFactory.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\ViewFactory.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\ViewLayout.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\ViewLayout.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\ViewWidgetWrapper.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\component\view\ViewWidgetWrapper.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\HierarchyCache.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\HierarchyCache.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\SqliteStorage.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\SqliteStorage.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\Storage.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\Storage.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\StorageCache.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\StorageCache.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\StorageTypes.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\TaskCleanStorage.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\TaskCleanStorage.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\access\StorageAccess.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\access\StorageAccess.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\access\StorageAccessProxy.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\access\StorageAccessProxy.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\Edge.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\Edge.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\Graph.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\Graph.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\Node.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\Node.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\Token.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\Token.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponent.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponent.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentAbstraction.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentAbstraction.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentAccess.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentAccess.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentAggregation.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentAggregation.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentConst.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentConst.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentFilePath.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentFilePath.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentSignature.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentSignature.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentStatic.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\graph\token_component\TokenComponentStatic.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\location\TokenLocation.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\location\TokenLocation.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\location\TokenLocationCollection.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\location\TokenLocationCollection.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\location\TokenLocationFile.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\location\TokenLocationFile.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\location\TokenLocationLine.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\location\TokenLocationLine.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\name\NameElement.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\name\NameElement.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\name\NameHierarchy.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\name\NameHierarchy.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\ParseFunction.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\ParseFunction.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\ParseLocation.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\ParseLocation.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\ParseTypeUsage.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\ParseTypeUsage.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\ParseVariable.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\ParseVariable.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\Parser.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\Parser.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\ParserClient.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\ParserClient.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\parser\cxx\TaskParseCxx.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\search\SearchIndex.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\search\SearchIndex.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\search\SearchMatch.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\search\SearchMatch.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\search\SearchNode.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\search\SearchNode.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\search\SearchResult.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\search\SearchResult.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\ArrayModifiedDataType.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\ArrayModifiedDataType.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\DataType.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\DataType.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\ModifiedDataType.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\ModifiedDataType.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\NamedDataType.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\NamedDataType.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\PointerModifiedDataType.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\PointerModifiedDataType.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\ReferenceModifiedDataType.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\data\type\ReferenceModifiedDataType.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\isTrial.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\settings\ApplicationSettings.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\settings\ApplicationSettings.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\settings\ColorScheme.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\settings\ColorScheme.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\settings\ProjectSettings.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\settings\ProjectSettings.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\settings\Settings.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\settings\Settings.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\ConfigManager.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\ConfigManager.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\Property.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\TimePoint.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\TimePoint.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\Version.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\Version.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\file\FileInfo.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\file\FileInfo.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\file\FileManager.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\file\FileManager.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\file\FilePath.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\file\FilePath.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\file\FileRegister.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\file\FileRegister.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\file\FileSystem.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\file\FileSystem.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\ConsoleLogger.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\ConsoleLogger.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\FileLogger.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\FileLogger.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\LogManager.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\LogManager.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\LogManagerImplementation.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\LogManagerImplementation.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\LogMessage.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\Logger.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\Logger.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\PlainFileLogger.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\PlainFileLogger.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\logging\logging.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\math\Color.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\math\MatrixBase.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\math\MatrixDynamicBase.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\math\Vector2.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\math\Vector4.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\math\VectorBase.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\Message.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\MessageBase.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\MessageListener.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\MessageListenerBase.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\MessageListenerBase.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\MessageQueue.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\MessageQueue.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageActivateEdge.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageActivateFile.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageActivateNodes.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageActivateTokenLocations.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageActivateTokens.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageActivateWindow.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageAutoRefreshChanged.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageDeactivateEdge.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageFind.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageFinishedParsing.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageFlushUpdates.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageFocusIn.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageFocusOut.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageGraphNodeBundleSplit.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageGraphNodeExpand.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageGraphNodeMove.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageInterruptTasks.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageLoadProject.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageMoveIDECursor.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageRedo.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageRefresh.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageResetZoom.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageSaveProject.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageSearch.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageSearchAutocomplete.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageShowErrors.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageShowFile.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageShowScope.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageShowSnippets.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageStatus.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageSwitchColorScheme.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageUndo.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageWindowFocus.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageZoom.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\LambdaTask.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\LambdaTask.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\SimpleTask.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\SimpleTask.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\Task.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\Task.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\TaskGroup.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\TaskGroup.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\TaskGroupSequential.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\TaskGroupSequential.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\TaskScheduler.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\scheduling\TaskScheduler.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\solution\ISolutionParser.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\solution\ISolutionParser.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\solution\SolutionParserVisualStudio.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\solution\SolutionParserVisualStudio.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\text\Dictionary.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\text\Dictionary.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\text\TextAccess.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\text\TextAccess.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\types.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\utility.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\utility.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\utilityString.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\utilityString.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\platform_includes\includesDefault.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\platform_includes\includesMac.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\platform_includes\includesWindows.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtAutocompletionList.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtAutocompletionList.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtCodeArea.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtCodeArea.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtCodeFile.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtCodeFile.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtCodeFileList.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtCodeFileList.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtCodeSnippet.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtCodeSnippet.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtDirectoryListBox.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtDirectoryListBox.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtLineEdit.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtLineEdit.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtRefreshBar.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtRefreshBar.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtSearchBar.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtSearchBar.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtSmartSearchBox.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtSmartSearchBox.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtStatusBar.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtStatusBar.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtUndoRedo.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\element\QtUndoRedo.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\graphics\QtAngledLineItem.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\graphics\QtAngledLineItem.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\graphics\QtCountCircleItem.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\graphics\QtCountCircleItem.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\graphics\QtRoundedRectItem.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\graphics\QtRoundedRectItem.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\graphics\QtStraightLineItem.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\graphics\QtStraightLineItem.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\network\QtIDECommunicationController.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\network\QtIDECommunicationController.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\network\QtNetworkFactory.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\network\QtNetworkFactory.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\network\QtTcpWrapper.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\network\QtTcpWrapper.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\utility\QtDeviceScaledPixmap.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\utility\QtDeviceScaledPixmap.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\utility\QtHighlighter.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\utility\QtHighlighter.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\utility\QtThreadedFunctor.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\utility\utilityQt.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\utility\utilityQt.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtCodeView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtCodeView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtCompositeView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtCompositeView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtGraphView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtGraphView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtGraphViewStyleImpl.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtGraphViewStyleImpl.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtMainView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtMainView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtRefreshView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtRefreshView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtSearchView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtSearchView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtStatusBarView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtStatusBarView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtUndoRedoView.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtUndoRedoView.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtViewFactory.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtViewFactory.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtViewWidgetWrapper.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\QtViewWidgetWrapper.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphEdge.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphEdge.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphNode.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphNode.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphNodeAccess.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphNodeAccess.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphNodeBundle.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphNodeBundle.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphNodeData.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphNodeData.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphNodeExpandToggle.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\QtGraphNodeExpandToggle.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\nodeComponents\QtGraphNodeComponent.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\nodeComponents\QtGraphNodeComponent.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\nodeComponents\QtGraphNodeComponentClickable.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\nodeComponents\QtGraphNodeComponentClickable.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\nodeComponents\QtGraphNodeComponentMoveable.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\view\graphElements\nodeComponents\QtGraphNodeComponentMoveable.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtAbout.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtAbout.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtAboutLicense.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtAboutLicense.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtApplicationSettingsScreen.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtApplicationSettingsScreen.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtMainWindow.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtMainWindow.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtProjectSetupScreen.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtProjectSetupScreen.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtSettingsWindow.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtSettingsWindow.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtSplashScreen.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtSplashScreen.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtStartScreen.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_gui\qt\window\QtStartScreen.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTAction.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTAction.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTActionFactory.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTActionFactory.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTBodyVisitor.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTBodyVisitor.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTBodyVisitorClient.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTBodyVisitorClient.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTConsumer.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTConsumer.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTVisitor.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\ASTVisitor.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\CommentHandler.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\CommentHandler.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\CxxDiagnosticConsumer.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\CxxDiagnosticConsumer.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\CxxParser.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\CxxParser.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\PreprocessorCallbacks.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\PreprocessorCallbacks.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\name_resolver\CxxDeclNameResolver.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\name_resolver\CxxDeclNameResolver.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\name_resolver\CxxNameResolver.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\name_resolver\CxxNameResolver.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\name_resolver\CxxTemplateArgumentNameResolver.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\name_resolver\CxxTemplateArgumentNameResolver.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\name_resolver\CxxTypeNameResolver.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\name_resolver\CxxTypeNameResolver.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\utilityCxx.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib_parser\data\parser\cxx\utilityCxx.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\ConfigManagerTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\CxxParserTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\DataTypeTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\DictionaryTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\FileManagerTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\FilePathTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\FileSystemTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\GraphTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\LogManagerTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\MatrixBaseTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\MessageQueueTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\NetworkProtocolHelperTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\SearchIndexTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\SettingsTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\SqliteStorageTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\StorageTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\TaskSchedulerTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\TestSuiteFixture.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\TestSuiteFixture.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\TextAccessTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\TokenLocationCollectionTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\UtilityStringTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\Vector2TestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\VsSolutionParserTestSuite.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\helper\TestFileManager.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\helper\TestFileManager.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\helper\TestStorage.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\test\helper\TestStorage.h" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\trial\data\parser\cxx\TaskParseCxx.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\trial\isTrial.cpp" +SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\trial\main.cpp" diff --git a/src/app/data/parser/cxx/TaskParseCxx.cpp b/src/app/data/parser/cxx/TaskParseCxx.cpp index d06a868e..c266085d 100644 --- a/src/app/data/parser/cxx/TaskParseCxx.cpp +++ b/src/app/data/parser/cxx/TaskParseCxx.cpp @@ -70,7 +70,7 @@ Task::TaskState TaskParseCxx::update() MessageStatus(ss.str(), false, true).dispatch(); - m_client->prepareParsingFile(sourcePath); + m_client->startParsingFile(sourcePath); m_parser->runTool(std::vector(1, sourcePath.str())); diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index b8bcb3ff..90b6e32e 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -291,6 +291,7 @@ add_files( utility/Property.h utility/ResourcePaths.cpp utility/ResourcePaths.h + utility/ScopedSwitcher.h utility/TimePoint.cpp utility/TimePoint.h utility/types.h diff --git a/src/lib/component/controller/CodeController.cpp b/src/lib/component/controller/CodeController.cpp index 61f0348f..ad3abf0d 100644 --- a/src/lib/component/controller/CodeController.cpp +++ b/src/lib/component/controller/CodeController.cpp @@ -405,7 +405,7 @@ std::vector CodeController::getSnippetsForFile(std::shared_pt )->forEachStartTokenLocation( // this TokenLocationFile only contains a single StartTokenLocation. [&](TokenLocation* location) { - params.title = m_storageAccess->getNameHierarchyForNodeWithId(location->getTokenId()).getFullName(); + params.title = m_storageAccess->getNameHierarchyForNodeWithId(location->getTokenId()).getQualifiedName(); params.titleId = location->getId(); } ); @@ -430,7 +430,7 @@ std::vector CodeController::getSnippetsForFile(std::shared_pt )->forEachStartTokenLocation( // this TokenLocationFile only contains a single StartTokenLocation. [&](TokenLocation* location) { - params.footer = m_storageAccess->getNameHierarchyForNodeWithId(location->getTokenId()).getFullName(); + params.footer = m_storageAccess->getNameHierarchyForNodeWithId(location->getTokenId()).getQualifiedName(); params.footerId = location->getId(); } ); diff --git a/src/lib/component/controller/UndoRedoController.cpp b/src/lib/component/controller/UndoRedoController.cpp index 70717bf1..b13edeff 100644 --- a/src/lib/component/controller/UndoRedoController.cpp +++ b/src/lib/component/controller/UndoRedoController.cpp @@ -55,10 +55,12 @@ void UndoRedoController::handleMessage(MessageActivateFile* message) void UndoRedoController::handleMessage(MessageActivateNodes* message) { - if (m_lastCommand.message && m_lastCommand.message->getType() == message->getType() && message->nodes.size() && + if (m_lastCommand.message && + m_lastCommand.message->getType() == message->getType() && + message->nodes.size() && static_cast(m_lastCommand.message.get())->nodes.size() == message->nodes.size() && - static_cast(m_lastCommand.message.get())->nodes[0].nameHierarchy.getFullName() == - message->nodes[0].nameHierarchy.getFullName()) + static_cast(m_lastCommand.message.get())->nodes[0].nameHierarchy.getQualifiedNameWithSignature() == + message->nodes[0].nameHierarchy.getQualifiedNameWithSignature()) { return; } diff --git a/src/lib/data/Storage.cpp b/src/lib/data/Storage.cpp index 4e86df6b..bee65c26 100644 --- a/src/lib/data/Storage.cpp +++ b/src/lib/data/Storage.cpp @@ -177,7 +177,7 @@ void Storage::finishParsing() buildHierarchyCache(); } -void Storage::prepareParsingFile(const FilePath& filePath) +void Storage::startParsingFile(const FilePath& filePath) { m_sqliteStorage.beginTransaction(); } @@ -214,32 +214,26 @@ size_t Storage::getErrorCount() const } Id Storage::onTypedefParsed( - const ParseLocation& location, const NameHierarchy& nameHierarchy, const ParseTypeUsage& underlyingType, - AccessType access + const ParseLocation& location, const NameHierarchy& typedefName, AccessType access ){ - log("typedef", nameHierarchy.getFullName() + " -> " + underlyingType.dataType->getFullTypeName(), location); + log("typedef", typedefName.getQualifiedName(), location); - Id typedefNodeId = addNodeHierarchy(Node::NODE_TYPEDEF, nameHierarchy, true); - addSourceLocation(typedefNodeId, location); - addAccess(typedefNodeId, access); + Id nodeId = addNodeHierarchy(Node::NODE_TYPEDEF, typedefName, true); + addSourceLocation(nodeId, location); + addAccess(nodeId, access); - Id underlyingTypeNodeId = addNodeHierarchy(Node::NODE_TYPE, underlyingType.dataType->getTypeNameHierarchy(), false); - addEdge(typedefNodeId, underlyingTypeNodeId, Edge::EDGE_TYPEDEF_OF, location); - - return typedefNodeId; + return nodeId; } Id Storage::onClassParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation ){ - log("class", nameHierarchy.getFullName(), location); + log("class", nameHierarchy.getQualifiedName(), location); Id nodeId = addNodeHierarchy(Node::NODE_CLASS, nameHierarchy, scopeLocation.isValid()); - addSourceLocation(nodeId, location); addSourceLocation(nodeId, scopeLocation, true); - addAccess(nodeId, access); return nodeId; @@ -249,63 +243,43 @@ Id Storage::onStructParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation ){ - log("struct", nameHierarchy.getFullName(), location); + log("struct", nameHierarchy.getQualifiedName(), location); Id nodeId = addNodeHierarchy(Node::NODE_STRUCT, nameHierarchy, scopeLocation.isValid()); - addSourceLocation(nodeId, location); addSourceLocation(nodeId, scopeLocation, true); - addAccess(nodeId, access); return nodeId; } -Id Storage::onGlobalVariableParsed(const ParseLocation& location, const ParseVariable& variable) +Id Storage::onGlobalVariableParsed(const ParseLocation& location, const NameHierarchy& variable) { - log("global", variable.getFullName(), location); + log("global", variable.getQualifiedName(), location); - Id nodeId = addNodeHierarchy(Node::NODE_GLOBAL_VARIABLE, variable.nameHierarchy, true); + Id nodeId = addNodeHierarchy(Node::NODE_GLOBAL_VARIABLE, variable, true); addSourceLocation(nodeId, location); - Id typeNodeId = addNodeHierarchy(Node::NODE_TYPE, variable.type.dataType->getTypeNameHierarchy(), false); - addEdge(nodeId, typeNodeId, Edge::EDGE_TYPE_OF, location); - return nodeId; } -Id Storage::onFieldParsed(const ParseLocation& location, const ParseVariable& variable, AccessType access) +Id Storage::onFieldParsed(const ParseLocation& location, const NameHierarchy& field, AccessType access) { - log("field", variable.getFullName(), location); + log("field", field.getQualifiedName(), location); - Id nodeId = addNodeHierarchy(Node::NODE_FIELD, variable.nameHierarchy, true); + Id nodeId = addNodeHierarchy(Node::NODE_FIELD, field, true); addSourceLocation(nodeId, location); addAccess(nodeId, access); - Id typeNodeId = addNodeHierarchy(Node::NODE_TYPE, variable.type.dataType->getTypeNameHierarchy(), false); - addEdge(nodeId, typeNodeId, Edge::EDGE_TYPE_OF, variable.type.location); - return nodeId; } Id Storage::onFunctionParsed( - const ParseLocation& location, const ParseFunction& function, const ParseLocation& scopeLocation + const ParseLocation& location, const NameHierarchy& function, const ParseLocation& scopeLocation ){ - log("function", function.getFullName(), location); + log("function", function.getQualifiedNameWithSignature(), location); Id nodeId = addNodeHierarchy(Node::NODE_FUNCTION, function, true); - - Id returnTypeNodeId = addNodeHierarchy(Node::NODE_TYPE, function.returnType.dataType->getTypeNameHierarchy(), false); - addEdge(nodeId, returnTypeNodeId, Edge::EDGE_TYPE_USAGE, function.returnType.location); - // addEdge(nodeId, returnTypeNodeId, Edge::EDGE_RETURN_TYPE_OF, function.returnType.location); - - for (size_t i = 0; i < function.parameters.size(); i++) - { - Id parameternTypeNodeId = addNodeHierarchy(Node::NODE_TYPE, function.parameters[i].dataType->getTypeNameHierarchy(), false); - addEdge(nodeId, parameternTypeNodeId, Edge::EDGE_TYPE_USAGE, function.parameters[i].location); - // addEdge(nodeId, parameternTypeNodeId, Edge::EDGE_PARAMETER_TYPE_OF, function.parameters[i].location); - } - addSourceLocation(nodeId, location); addSourceLocation(nodeId, scopeLocation, true); @@ -313,40 +287,25 @@ Id Storage::onFunctionParsed( } Id Storage::onMethodParsed( - const ParseLocation& location, const ParseFunction& method, AccessType access, AbstractionType abstraction, + const ParseLocation& location, const NameHierarchy& method, AccessType access, AbstractionType abstraction, const ParseLocation& scopeLocation ){ - log("method", method.getFullName(), location); + log("method", method.getQualifiedNameWithSignature(), location); Id nodeId = addNodeHierarchy(Node::NODE_METHOD, method, location.isValid() && scopeLocation.isValid()); addSourceLocation(nodeId, location); addSourceLocation(nodeId, scopeLocation, true); addAccess(nodeId, access); - if (method.returnType.location.isValid()) - { - Id returnTypeNodeId = addNodeHierarchy(Node::NODE_TYPE, method.returnType.dataType->getTypeNameHierarchy(), false); - addEdge(nodeId, returnTypeNodeId, Edge::EDGE_TYPE_USAGE, method.returnType.location); - // addEdge(nodeId, returnTypeNodeId, Edge::EDGE_RETURN_TYPE_OF, method.returnType.location); - } - - for (size_t i = 0; i < method.parameters.size(); i++) - { - Id parameternTypeNodeId = addNodeHierarchy(Node::NODE_TYPE, method.parameters[i].dataType->getTypeNameHierarchy(), false); - addEdge(nodeId, parameternTypeNodeId, Edge::EDGE_TYPE_USAGE, method.parameters[i].location); - // addEdge(nodeId, parameternTypeNodeId, Edge::EDGE_PARAMETER_TYPE_OF, method.parameters[i].location); - } - return nodeId; } Id Storage::onNamespaceParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, const ParseLocation& scopeLocation ){ - log("namespace", nameHierarchy.getFullName(), location); + log("namespace", nameHierarchy.getQualifiedName(), location); Id nodeId = addNodeHierarchy(Node::NODE_NAMESPACE, nameHierarchy, true); - addSourceLocation(nodeId, location); addSourceLocation(nodeId, scopeLocation, true); @@ -357,7 +316,7 @@ Id Storage::onEnumParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation ){ - log("enum", nameHierarchy.getFullName(), location); + log("enum", nameHierarchy.getQualifiedName(), location); Id nodeId = addNodeHierarchy(Node::NODE_ENUM, nameHierarchy, true); @@ -370,7 +329,7 @@ Id Storage::onEnumParsed( Id Storage::onEnumConstantParsed(const ParseLocation& location, const NameHierarchy& nameHierarchy) { - log("enum constant", nameHierarchy.getFullName(), location); + log("enum constant", nameHierarchy.getQualifiedName(), location); Id nodeId = addNodeHierarchy(Node::NODE_ENUM_CONSTANT, nameHierarchy, true); @@ -383,7 +342,7 @@ Id Storage::onInheritanceParsed( const ParseLocation& location, const NameHierarchy& childNameHierarchy, const NameHierarchy& parentNameHierarchy, AccessType access ){ - log("inheritance", childNameHierarchy.getFullName() + " : " + parentNameHierarchy.getFullName(), location); + log("inheritance", childNameHierarchy.getQualifiedName() + " : " + parentNameHierarchy.getQualifiedName(), location); Id childNodeId = addNodeHierarchy(Node::NODE_TYPE, childNameHierarchy, false); Id parentNodeId = addNodeHierarchy(Node::NODE_TYPE, parentNameHierarchy, false); @@ -394,11 +353,11 @@ Id Storage::onInheritanceParsed( } Id Storage::onMethodOverrideParsed( - const ParseLocation& location, const ParseFunction& base, const ParseFunction& overrider) + const ParseLocation& location, const NameHierarchy& overridden, const NameHierarchy& overrider) { - log("override", base.getFullName() + " -> " + overrider.getFullName(), location); + log("override", overridden.getQualifiedNameWithSignature() + " -> " + overrider.getQualifiedNameWithSignature(), location); - Id baseNodeId = addNodeHierarchy(Node::NODE_FUNCTION, base, false); // TODO: call this overridden + Id baseNodeId = addNodeHierarchy(Node::NODE_FUNCTION, overridden, false); Id overriderNodeId = addNodeHierarchy(Node::NODE_FUNCTION, overrider, false); Id edgeId = addEdge(overriderNodeId, baseNodeId, Edge::EDGE_OVERRIDE, location); @@ -406,9 +365,9 @@ Id Storage::onMethodOverrideParsed( return edgeId; } -Id Storage::onCallParsed(const ParseLocation& location, const ParseFunction& caller, const ParseFunction& callee) +Id Storage::onCallParsed(const ParseLocation& location, const NameHierarchy& caller, const NameHierarchy& callee) { - log("call", caller.getFullName() + " -> " + callee.getFullName(), location); + log("call", caller.getQualifiedNameWithSignature() + " -> " + callee.getQualifiedNameWithSignature(), location); Id callerNodeId = addNodeHierarchy(Node::NODE_FUNCTION, caller, false); Id calleeNodeId = addNodeHierarchy(Node::NODE_FUNCTION, callee, false); @@ -418,37 +377,12 @@ Id Storage::onCallParsed(const ParseLocation& location, const ParseFunction& cal return edgeId; } -Id Storage::onCallParsed(const ParseLocation& location, const ParseVariable& caller, const ParseFunction& callee) -{ - log("call", caller.getFullName() + " -> " + callee.getFullName(), location); - - Id callerNodeId = addNodeHierarchy(Node::NODE_UNDEFINED, caller.nameHierarchy, false); - Id calleeNodeId = addNodeHierarchy(Node::NODE_FUNCTION, callee, false); - - Id edgeId = addEdge(callerNodeId, calleeNodeId, Edge::EDGE_CALL, location); - - return edgeId; -} - Id Storage::onFieldUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy ){ - log("field usage", user.getFullName() + " -> " + usedNameHierarchy.getFullName(), location); + log("field usage", userNameHierarchy.getQualifiedNameWithSignature() + " -> " + usedNameHierarchy.getQualifiedName(), location); - Id userNodeId = addNodeHierarchy(Node::NODE_FUNCTION, user, false); - Id usedNodeId = addNodeHierarchy(Node::NODE_FIELD, usedNameHierarchy, false); - - Id edgeId = addEdge(userNodeId, usedNodeId, Edge::EDGE_USAGE, location); - - return edgeId; -} - -Id Storage::onFieldUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy -){ - log("global usage", user.getFullName() + " -> " + usedNameHierarchy.getFullName(), location); - - Id userNodeId = addNodeHierarchy(Node::NODE_FUNCTION, user.nameHierarchy, false); + Id userNodeId = addNodeHierarchy(Node::NODE_FUNCTION, userNameHierarchy, false); Id usedNodeId = addNodeHierarchy(Node::NODE_FIELD, usedNameHierarchy, false); Id edgeId = addEdge(userNodeId, usedNodeId, Edge::EDGE_USAGE, location); @@ -457,24 +391,11 @@ Id Storage::onFieldUsageParsed( } Id Storage::onGlobalVariableUsageParsed( // or static variable used - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy ){ - log("global usage", user.getFullName() + " -> " + usedNameHierarchy.getFullName(), location); + log("global usage", userNameHierarchy.getQualifiedNameWithSignature() + " -> " + usedNameHierarchy.getQualifiedNameWithSignature(), location); - Id userNodeId = addNodeHierarchy(Node::NODE_FUNCTION, user, false); - Id usedNodeId = addNodeHierarchy(Node::NODE_GLOBAL_VARIABLE, usedNameHierarchy, false); - - Id edgeId = addEdge(userNodeId, usedNodeId, Edge::EDGE_USAGE, location); - - return edgeId; -} - -Id Storage::onGlobalVariableUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy) -{ - log("global usage", user.getFullName() + " -> " + usedNameHierarchy.getFullName(), location); - - Id userNodeId = addNodeHierarchy(Node::NODE_GLOBAL_VARIABLE, user.nameHierarchy, false); + Id userNodeId = addNodeHierarchy(Node::NODE_FUNCTION, userNameHierarchy, false); Id usedNodeId = addNodeHierarchy(Node::NODE_GLOBAL_VARIABLE, usedNameHierarchy, false); Id edgeId = addEdge(userNodeId, usedNodeId, Edge::EDGE_USAGE, location); @@ -483,99 +404,47 @@ Id Storage::onGlobalVariableUsageParsed( } Id Storage::onEnumConstantUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy ){ - log("enum constant usage", user.getFullName() + " -> " + usedNameHierarchy.getFullName(), location); + log("enum constant usage", userNameHierarchy.getQualifiedNameWithSignature() + " -> " + usedNameHierarchy.getQualifiedNameWithSignature(), location); - Id userNodeId = addNodeHierarchy(Node::NODE_FUNCTION, user, false); - Id usedNodeId = addNodeHierarchy(Node::NODE_GLOBAL_VARIABLE, usedNameHierarchy, false); + Id userNodeId = addNodeHierarchy(Node::NODE_UNDEFINED, userNameHierarchy, false); + Id usedNodeId = addNodeHierarchy(Node::NODE_ENUM_CONSTANT, usedNameHierarchy, false); Id edgeId = addEdge(userNodeId, usedNodeId, Edge::EDGE_USAGE, location); return edgeId; } -Id Storage::onEnumConstantUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy -){ - log("enum constant usage", user.getFullName() + " -> " + usedNameHierarchy.getFullName(), location); - - Id userNodeId = addNodeHierarchy(Node::NODE_FUNCTION, user.nameHierarchy, false); - Id usedNodeId = addNodeHierarchy(Node::NODE_GLOBAL_VARIABLE, usedNameHierarchy, false); - - Id edgeId = addEdge(userNodeId, usedNodeId, Edge::EDGE_USAGE, location); - - return edgeId; -} - -Id Storage::onTypeUsageParsed(const ParseTypeUsage& typeUsage, const ParseFunction& function) // check if type has valid location +Id Storage::onTypeUsageParsed(const ParseLocation& location, const NameHierarchy& user, const NameHierarchy& used) { - log("type usage", function.getFullName() + " -> " + typeUsage.dataType->getRawTypeName(), typeUsage.location); + log("type usage", user.getQualifiedNameWithSignature() + " -> " + used.getQualifiedName(), location); - if (!typeUsage.location.isValid()) + if (!location.isValid()) { return 0; } - Id functionNodeId = addNodeHierarchy(Node::NODE_FUNCTION, function, false); - Id typeNodeId = addNodeHierarchy(Node::NODE_TYPE, typeUsage.dataType->getTypeNameHierarchy(), false); + Id functionNodeId = addNodeHierarchy(Node::NODE_UNDEFINED, user, false); + Id typeNodeId = addNodeHierarchy(Node::NODE_TYPE, used, false); - Id edgeId = addEdge(functionNodeId, typeNodeId, Edge::EDGE_TYPE_USAGE, typeUsage.location); + Id edgeId = addEdge(functionNodeId, typeNodeId, Edge::EDGE_TYPE_USAGE, location); return edgeId; } -Id Storage::onTypeUsageParsed(const ParseTypeUsage& typeUsage, const ParseVariable& variable) -{ - log("type usage", variable.getFullName() + " -> " + typeUsage.dataType->getRawTypeName(), typeUsage.location); - - if (!typeUsage.location.isValid()) - { - return 0; - } - - Id functionNodeId = addNodeHierarchy(Node::NODE_UNDEFINED, variable.nameHierarchy, false); - Id typeNodeId = addNodeHierarchy(Node::NODE_TYPE, typeUsage.dataType->getTypeNameHierarchy(), false); - - Id edgeId = addEdge(functionNodeId, typeNodeId, Edge::EDGE_TYPE_USAGE, typeUsage.location); - - return edgeId; -} - -Id Storage::onTemplateArgumentTypeOfTemplateRecordParsed( +Id Storage::onTemplateArgumentTypeParsed( const ParseLocation& location, const NameHierarchy& argumentTypeNameHierarchy, const NameHierarchy& templateNameHierarchy) { log( "template argument type", - argumentTypeNameHierarchy.getFullName() + " -> " + templateNameHierarchy.getFullName(), + argumentTypeNameHierarchy.getQualifiedName() + " -> " + templateNameHierarchy.getQualifiedName(), location ); Id argumentNodeId = addNodeHierarchy(Node::NODE_TYPE, argumentTypeNameHierarchy, false); - // does not need a source location because this type that is already defined (and therefore has a location). - - Id templateNodeId = addNodeHierarchy(Node::NODE_TYPE, templateNameHierarchy, false); - - addEdge(templateNodeId, argumentNodeId, Edge::EDGE_TEMPLATE_ARGUMENT, location); - - return argumentNodeId; -} - -Id Storage::onTemplateArgumentTypeOfTemplateFunctionParsed( - const ParseLocation& location, const NameHierarchy& argumentTypeNameHierarchy, - const ParseFunction& templateFunction) -{ - log( - "template argument type", - argumentTypeNameHierarchy.getFullName() + " -> " + templateFunction.getFullName(), - location - ); - - Id argumentNodeId = addNodeHierarchy(Node::NODE_TYPE, argumentTypeNameHierarchy, false); - // does not need a source location because this type that is already defined (and therefore has a location). - - Id templateNodeId = addNodeHierarchy(Node::NODE_FUNCTION, templateFunction, false); + Id templateNodeId = addNodeHierarchy(Node::NODE_UNDEFINED, templateNameHierarchy, false); addEdge(templateNodeId, argumentNodeId, Edge::EDGE_TEMPLATE_ARGUMENT, location); @@ -583,78 +452,62 @@ Id Storage::onTemplateArgumentTypeOfTemplateFunctionParsed( } Id Storage::onTemplateDefaultArgumentTypeParsed( - const ParseTypeUsage& defaultArgumentTypeUsage, - const NameHierarchy& templateParameterNameHierarchy // actually this is the template parameter??? + const ParseLocation& location, const NameHierarchy& defaultArgumentTypeNameHierarchy, + const NameHierarchy& templateParameterNameHierarchy ){ log( "template default argument", - defaultArgumentTypeUsage.dataType->getTypeNameHierarchy().getFullName() + " -> " + templateParameterNameHierarchy.getFullName(), - defaultArgumentTypeUsage.location + defaultArgumentTypeNameHierarchy.getQualifiedNameWithSignature() + " -> " + templateParameterNameHierarchy.getQualifiedName(), + location ); - Id defaultArgumentNodeId = addNodeHierarchy(Node::NODE_TYPE, defaultArgumentTypeUsage.dataType->getTypeNameHierarchy(), false); - // does not need a source location because this type that is already defined (and therefore has a location). + Id defaultArgumentNodeId = addNodeHierarchy(Node::NODE_TYPE, defaultArgumentTypeNameHierarchy, false); + Id parameterNodeId = addNodeHierarchy(Node::NODE_TYPE, templateParameterNameHierarchy, false); - Id argumentNodeId = addNodeHierarchy(Node::NODE_TYPE, templateParameterNameHierarchy, false); - - addEdge(argumentNodeId, defaultArgumentNodeId, Edge::EDGE_TEMPLATE_DEFAULT_ARGUMENT, defaultArgumentTypeUsage.location); + addEdge(parameterNodeId, defaultArgumentNodeId, Edge::EDGE_TEMPLATE_DEFAULT_ARGUMENT, location); return defaultArgumentNodeId; } -Id Storage::onTemplateRecordParameterTypeParsed( - const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy, - const NameHierarchy& templateRecordNameHierarchy +Id Storage::onTemplateParameterTypeParsed( + const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy ){ - log("template record type parameter", templateParameterTypeNameHierarchy.getFullName(), location); + log("template parameter type", templateParameterTypeNameHierarchy.getQualifiedName(), location); Id parameterNodeId = addNodeHierarchy(Node::NODE_TEMPLATE_PARAMETER_TYPE, templateParameterTypeNameHierarchy, true); addSourceLocation(parameterNodeId, location, false); addAccess(parameterNodeId, TokenComponentAccess::ACCESS_TEMPLATE); - addNodeHierarchy(Node::NODE_TYPE, templateRecordNameHierarchy, false); - return parameterNodeId; } -Id Storage::onTemplateRecordSpecializationParsed( - const ParseLocation& location, const NameHierarchy& specializedRecordNameHierarchy, - const RecordType specializedRecordType, const NameHierarchy& specializedFromNameHierarchy +Id Storage::onTemplateSpecializationParsed( + const ParseLocation& location, const NameHierarchy& specializedNameHierarchy, + const NameHierarchy& specializedFromNameHierarchy ){ log( "template record specialization", - specializedRecordNameHierarchy.getFullName() + " -> " + specializedFromNameHierarchy.getFullName(), + specializedNameHierarchy.getQualifiedName() + " -> " + specializedFromNameHierarchy.getQualifiedName(), location ); - Node::NodeType specializedRecordNodeType = Node::NODE_CLASS; - if (specializedRecordType == ParserClient::RECORD_STRUCT) - { - specializedRecordNodeType = Node::NODE_STRUCT; - } - - Id specializedNodeId = addNodeHierarchy(specializedRecordNodeType, specializedRecordNameHierarchy, true); - addSourceLocation(specializedNodeId, location, false); - + Id specializedId = addNodeHierarchy(Node::NODE_TYPE, specializedNameHierarchy, false); Id recordNodeId = addNodeHierarchy(Node::NODE_TYPE, specializedFromNameHierarchy, false); - addAccess(specializedNodeId, getAccess(recordNodeId)); + Id edgeId = addEdge(specializedId, recordNodeId, Edge::EDGE_TEMPLATE_SPECIALIZATION_OF, location); - addEdge(specializedNodeId, recordNodeId, Edge::EDGE_TEMPLATE_SPECIALIZATION_OF, location); - - return specializedNodeId; + return edgeId; } Id Storage::onTemplateMemberFunctionSpecializationParsed( - const ParseLocation& location, const ParseFunction& instantiatedFunction, const ParseFunction& specializedFunction + const ParseLocation& location, const NameHierarchy& instantiatedFunction, const NameHierarchy& specializedFunction ){ log( "template member function specialization", - instantiatedFunction.getFullName() + " -> " + specializedFunction.getFullName(), + instantiatedFunction.getQualifiedNameWithSignature() + " -> " + specializedFunction.getQualifiedNameWithSignature(), location ); Id instantiatedFunctionNodeId = addNodeHierarchy(Node::NODE_FUNCTION, instantiatedFunction, false); - Id specializedFunctionNodeId = addNodeHierarchy(Node::NODE_FUNCTION, specializedFunction, false); Id edgeId = addEdge(instantiatedFunctionNodeId, specializedFunctionNodeId, Edge::EDGE_TEMPLATE_MEMBER_SPECIALIZATION_OF, location); @@ -662,34 +515,16 @@ Id Storage::onTemplateMemberFunctionSpecializationParsed( return edgeId; } -Id Storage::onTemplateFunctionParameterTypeParsed( - const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy, const ParseFunction function -){ - log("template function type parameter", templateParameterTypeNameHierarchy.getFullName(), location); - - Id parameterNodeId = addNodeHierarchy(Node::NODE_TEMPLATE_PARAMETER_TYPE, templateParameterTypeNameHierarchy, true); - addSourceLocation(parameterNodeId, location, false); - addAccess(parameterNodeId, TokenComponentAccess::ACCESS_TEMPLATE); - - addNodeHierarchy(Node::NODE_FUNCTION, function, false); - - return parameterNodeId; -} - Id Storage::onTemplateFunctionSpecializationParsed( - const ParseLocation& location, const ParseFunction specializedFunction, const ParseFunction templateFunction + const ParseLocation& location, const NameHierarchy specializedFunction, const NameHierarchy templateFunction ){ - log("function template specialization", specializedFunction.getFullName(), location); + log("function template specialization", specializedFunction.getQualifiedNameWithSignature(), location); - Id specializedNodeId = addNodeHierarchy(Node::NODE_FUNCTION, specializedFunction, true); - addSourceLocation(specializedNodeId, location, false); + Id specializedNodeId = addNodeHierarchy(Node::NODE_TYPE, specializedFunction, true); + Id functionNodeId = addNodeHierarchy(Node::NODE_TYPE, templateFunction, false); + Id edgeId = addEdge(specializedNodeId, functionNodeId, Edge::EDGE_TEMPLATE_SPECIALIZATION_OF, location); - Id functionNodeId = addNodeHierarchy(Node::NODE_FUNCTION, templateFunction, false); - addAccess(specializedNodeId, getAccess(functionNodeId)); - - addEdge(specializedNodeId, functionNodeId, Edge::EDGE_TEMPLATE_SPECIALIZATION_OF, location); - - return specializedNodeId; + return edgeId; } Id Storage::onFileParsed(const FileInfo& fileInfo) @@ -727,7 +562,7 @@ Id Storage::onFileIncludeParsed(const ParseLocation& location, const FileInfo& f Id Storage::onMacroDefineParsed( const ParseLocation& location, const NameHierarchy& macroNameHierarchy, const ParseLocation& scopeLocation ){ - log("macro", macroNameHierarchy.getFullName(), location); + log("macro", macroNameHierarchy.getQualifiedName(), location); Id macroId = addNodeHierarchy(Node::NODE_MACRO, macroNameHierarchy, true); addSourceLocation(macroId, location); @@ -741,7 +576,7 @@ Id Storage::onMacroDefineParsed( Id Storage::onMacroExpandParsed(const ParseLocation &location, const NameHierarchy& macroNameHierarchy) { - log("macro use", macroNameHierarchy.getFullName(), location); + log("macro use", macroNameHierarchy.getQualifiedName(), location); Id macroExpandId = addNodeHierarchy(Node::NODE_MACRO, macroNameHierarchy, false); Id fileNodeId = getFileNodeId(location.filePath); @@ -1399,7 +1234,7 @@ Id Storage::addNodeHierarchy(Node::NodeType nodeType, NameHierarchy nameHierarch else if (isLastElement) // Update the type of the last node if the new type is more specific. { Node::NodeType storedType = Node::intToType(node.type); - if (type > storedType) + if (!node.defined && type > storedType) { m_sqliteStorage.setNodeType(Node::typeToInt(type), nodeId); } @@ -1411,11 +1246,6 @@ Id Storage::addNodeHierarchy(Node::NodeType nodeType, NameHierarchy nameHierarch return parentNodeId; } -Id Storage::addNodeHierarchy(Node::NodeType type, const ParseFunction& function, bool defined) -{ - return addNodeHierarchy(type, function.nameHierarchy, defined); -} - Id Storage::addSourceLocation(Id elementNodeId, const ParseLocation &location, bool isScope) { if (!location.isValid()) @@ -1671,11 +1501,11 @@ void Storage::addNodesToGraph(const std::vector nodeIds, Graph* graph) const if (type == Node::NODE_FUNCTION || type == Node::NODE_METHOD) { - std::shared_ptr lastElement = nameHierarchy.back(); - if (lastElement) + std::string signatureString = nameHierarchy.getRawNameWithSignature(); + if (signatureString.size() > 0) // this should always be the case since functions and methods must have sigs. { node->addComponentSignature( - std::make_shared(lastElement->getFullSignature()) + std::make_shared(signatureString) ); } } diff --git a/src/lib/data/Storage.h b/src/lib/data/Storage.h index 7aa8a570..1a279723 100644 --- a/src/lib/data/Storage.h +++ b/src/lib/data/Storage.h @@ -43,34 +43,29 @@ public: virtual void startParsing(); virtual void finishParsing(); - virtual void prepareParsingFile(const FilePath& filePath); + virtual void startParsingFile(const FilePath& filePath); virtual void finishParsingFile(const FilePath& filePath); virtual void onError(const ParseLocation& location, const std::string& message); virtual size_t getErrorCount() const; virtual Id onTypedefParsed( - const ParseLocation& location, const NameHierarchy& nameHierarchy, - const ParseTypeUsage& underlyingType, AccessType access); + const ParseLocation& location, const NameHierarchy& typedefName, AccessType access); virtual Id onClassParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation); virtual Id onStructParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation); - - virtual Id onGlobalVariableParsed(const ParseLocation& location, const ParseVariable& variable); - virtual Id onFieldParsed(const ParseLocation& location, const ParseVariable& variable, AccessType access); - + virtual Id onGlobalVariableParsed(const ParseLocation& location, const NameHierarchy& variable); + virtual Id onFieldParsed(const ParseLocation& location, const NameHierarchy& field, AccessType access); virtual Id onFunctionParsed( - const ParseLocation& location, const ParseFunction& function, const ParseLocation& scopeLocation); + const ParseLocation& location, const NameHierarchy& function, const ParseLocation& scopeLocation); virtual Id onMethodParsed( - const ParseLocation& location, const ParseFunction& method, AccessType access, AbstractionType abstraction, + const ParseLocation& location, const NameHierarchy& method, AccessType access, AbstractionType abstraction, const ParseLocation& scopeLocation); - virtual Id onNamespaceParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, const ParseLocation& scopeLocation); - virtual Id onEnumParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation); @@ -80,47 +75,33 @@ public: const ParseLocation& location, const NameHierarchy& childNameHierarchy, const NameHierarchy& parentNameHierarchy, AccessType access); virtual Id onMethodOverrideParsed( - const ParseLocation& location, const ParseFunction& base, const ParseFunction& overrider); + const ParseLocation& location, const NameHierarchy& overridden, const NameHierarchy& overrider); virtual Id onCallParsed( - const ParseLocation& location, const ParseFunction& caller, const ParseFunction& callee); - virtual Id onCallParsed( - const ParseLocation& location, const ParseVariable& caller, const ParseFunction& callee); + const ParseLocation& location, const NameHierarchy& caller, const NameHierarchy& callee); virtual Id onFieldUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy); - virtual Id onFieldUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy); + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy); virtual Id onGlobalVariableUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy); - virtual Id onGlobalVariableUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy); + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy); virtual Id onEnumConstantUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy); - virtual Id onEnumConstantUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy); - virtual Id onTypeUsageParsed(const ParseTypeUsage& typeUsage, const ParseFunction& function); - virtual Id onTypeUsageParsed(const ParseTypeUsage& typeUsage, const ParseVariable& variable); + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy); + virtual Id onTypeUsageParsed(const ParseLocation& location, const NameHierarchy& user, const NameHierarchy& used); - virtual Id onTemplateArgumentTypeOfTemplateRecordParsed( + virtual Id onTemplateArgumentTypeParsed( const ParseLocation& location, const NameHierarchy& argumentTypeNameHierarchy, const NameHierarchy& templateNameHierarchy); - virtual Id onTemplateArgumentTypeOfTemplateFunctionParsed( - const ParseLocation& location, const NameHierarchy& argumentTypeNameHierarchy, - const ParseFunction& templateFunction); virtual Id onTemplateDefaultArgumentTypeParsed( - const ParseTypeUsage& defaultArgumentTypeUsage, const NameHierarchy& templateParameterNameHierarchy); - virtual Id onTemplateRecordParameterTypeParsed( - const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy, - const NameHierarchy& templateRecordNameHierarchy); - virtual Id onTemplateRecordSpecializationParsed( - const ParseLocation& location, const NameHierarchy& specializedRecordNameHierarchy, - const RecordType specializedRecordType, const NameHierarchy& specializedFromNameHierarchy); + const ParseLocation& location, const NameHierarchy& defaultArgumentTypeNameHierarchy, + const NameHierarchy& templateParameterNameHierarchy); + virtual Id onTemplateParameterTypeParsed( + const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy); + virtual Id onTemplateSpecializationParsed( + const ParseLocation& location, const NameHierarchy& specializedNameHierarchy, + const NameHierarchy& specializedFromNameHierarchy); virtual Id onTemplateMemberFunctionSpecializationParsed( - const ParseLocation& location, const ParseFunction& instantiatedFunction, const ParseFunction& specializedFunction); + const ParseLocation& location, const NameHierarchy& instantiatedFunction, const NameHierarchy& specializedFunction); - virtual Id onTemplateFunctionParameterTypeParsed( - const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy, const ParseFunction function); virtual Id onTemplateFunctionSpecializationParsed( - const ParseLocation& location, const ParseFunction specializedFunction, const ParseFunction templateFunction); + const ParseLocation& location, const NameHierarchy specializedFunction, const NameHierarchy templateFunction); virtual Id onFileParsed(const FileInfo& fileInfo); virtual Id onFileIncludeParsed( @@ -176,7 +157,6 @@ public: private: Id addNodeHierarchy(Node::NodeType nodeType, NameHierarchy nameHierarchy, bool defined); - Id addNodeHierarchy(Node::NodeType type, const ParseFunction& function, bool defined); Id addSourceLocation(Id elementNodeId, const ParseLocation &location, bool isScope = false); Id addEdge(Id sourceNodeId, Id targetNodeId, Edge::EdgeType type); diff --git a/src/lib/data/graph/Node.cpp b/src/lib/data/graph/Node.cpp index 9746c6fc..b280614d 100644 --- a/src/lib/data/graph/Node.cpp +++ b/src/lib/data/graph/Node.cpp @@ -129,12 +129,12 @@ bool Node::isType(NodeTypeMask mask) const std::string Node::getName() const { - return m_nameHierarchy.getName(); + return m_nameHierarchy.getRawName(); } std::string Node::getFullName() const { - return m_nameHierarchy.getFullName(); + return m_nameHierarchy.getQualifiedName(); } NameHierarchy Node::getNameHierarchy() const diff --git a/src/lib/data/name/NameElement.cpp b/src/lib/data/name/NameElement.cpp index 3d84b7dd..9bddeac8 100644 --- a/src/lib/data/name/NameElement.cpp +++ b/src/lib/data/name/NameElement.cpp @@ -1,12 +1,61 @@ #include "data/name/NameElement.h" -NameElement::NameElement(const std::string& name) - : m_name(name) - , m_signature("") +#include "utility/logging/logging.h" +#include "utility/utilityString.h" + +std::string NameElement::Signature::serialize(Signature signature) +{ + return signature.m_prefix + "\r" + signature.m_postfix; +} + +NameElement::Signature NameElement::Signature::deserialize(const std::string& serialized) +{ + std::vector serializedElements = utility::splitToVector(serialized, "\r"); + if (serializedElements.size() != 2) + { + LOG_ERROR("unable to deserialize name signature: " + serialized); // todo: obfuscate serialized! + } + return Signature(serializedElements[0], serializedElements[1]); +} + +NameElement::Signature::Signature() { } -NameElement::NameElement(const std::string& name, const std::string& signature) +NameElement::Signature::Signature(std::string prefix, std::string postfix) + : m_prefix(prefix) + , m_postfix(postfix) +{ +} + +std::string NameElement::Signature::qualifyName(const std::string& name) const +{ + if (!isValid()) + { + return name; + } + + std::string qualifiedName = m_prefix; + if (name.size() > 0) + { + qualifiedName += " " + name; + } + qualifiedName += m_postfix; + + return qualifiedName; +} + +bool NameElement::Signature::isValid() const +{ + return ((m_prefix + m_postfix).size() > 0); +} + +NameElement::NameElement(const std::string& name) + : m_name(name) +{ +} + +NameElement::NameElement(const std::string& name, const Signature& signature) : m_name(name) , m_signature(signature) { @@ -16,12 +65,22 @@ NameElement::~NameElement() { } -std::string NameElement::getFullName() const +std::string NameElement::getName() const { return m_name; } -std::string NameElement::getFullSignature() const +std::string NameElement::getNameWithSignature() const +{ + return m_signature.qualifyName(m_name); +} + +bool NameElement::hasSignature() const +{ + return m_signature.isValid(); +} + +NameElement::Signature NameElement::getSignature() { return m_signature; } diff --git a/src/lib/data/name/NameElement.h b/src/lib/data/name/NameElement.h index 2f59664f..565ea039 100644 --- a/src/lib/data/name/NameElement.h +++ b/src/lib/data/name/NameElement.h @@ -1,21 +1,43 @@ #ifndef NAME_ELEMENT_H #define NAME_ELEMENT_H +#include #include +#include + +class DataType; class NameElement { public: + class Signature + { + public: + static std::string serialize(Signature signature); + static Signature deserialize(const std::string& serialized); + + Signature(); + Signature(std::string prefix, std::string postfix); + std::string qualifyName(const std::string& name) const; + bool isValid() const; + + private: + std::string m_prefix; + std::string m_postfix; + }; + NameElement(const std::string& name); - NameElement(const std::string& name, const std::string& signature); + NameElement(const std::string& name, const Signature& signature); ~NameElement(); - std::string getFullName() const; - std::string getFullSignature() const; + std::string getName() const; + std::string getNameWithSignature() const; + bool hasSignature() const; + Signature getSignature(); private: std::string m_name; - std::string m_signature; + Signature m_signature; }; #endif // NAME_ELEMENT_H diff --git a/src/lib/data/name/NameHierarchy.cpp b/src/lib/data/name/NameHierarchy.cpp index ca540954..3102ba4e 100644 --- a/src/lib/data/name/NameHierarchy.cpp +++ b/src/lib/data/name/NameHierarchy.cpp @@ -8,10 +8,12 @@ std::string NameHierarchy::serialize(NameHierarchy nameHierarchy) std::string serializedName = ""; for (size_t i = 0; i < nameHierarchy.size(); i++) { - serializedName += nameHierarchy[i]->getFullName() + "\t"; - serializedName += nameHierarchy[i]->getFullSignature(); - if (i + 1 < nameHierarchy.size()) + if (i > 0) + { serializedName += "\n"; + } + serializedName += nameHierarchy[i]->getName() + "\t"; + serializedName += NameElement::Signature::serialize(nameHierarchy[i]->getSignature()); } return serializedName; } @@ -29,7 +31,7 @@ NameHierarchy NameHierarchy::deserialize(const std::string& serializedName) LOG_ERROR("unable to deserialize name hierarchy: " + serializedName); // todo: obfuscate serializedName! return NameHierarchy(); } - nameHierarchy.push(std::make_shared(nameParts[0], nameParts[1])); + nameHierarchy.push(std::make_shared(nameParts[0], NameElement::Signature::deserialize(nameParts[1]))); } return nameHierarchy; @@ -77,26 +79,44 @@ size_t NameHierarchy::size() const return m_elements.size(); } -std::string NameHierarchy::getFullName() const +std::string NameHierarchy::getQualifiedName() const { std::string name; for (size_t i = 0; i < m_elements.size(); i++) { - name += m_elements[i]->getFullName(); - if (i + 1 < m_elements.size()) + if (i > 0) { name += "::"; } + name += m_elements[i]->getName(); } return name; } -std::string NameHierarchy::getName() const +std::string NameHierarchy::getQualifiedNameWithSignature() const +{ + std::string name = getQualifiedName(); + if (m_elements.size()) + { + name = m_elements.back()->getSignature().qualifyName(name); + } + return name; +} + +std::string NameHierarchy::getRawName() const { if (m_elements.size()) { - return m_elements.back()->getFullName(); + return m_elements.back()->getName(); + } + return ""; +} + +std::string NameHierarchy::getRawNameWithSignature() const +{ + if (m_elements.size()) + { + return m_elements.back()->getNameWithSignature(); } - return ""; } diff --git a/src/lib/data/name/NameHierarchy.h b/src/lib/data/name/NameHierarchy.h index 4a81b12f..c087e458 100644 --- a/src/lib/data/name/NameHierarchy.h +++ b/src/lib/data/name/NameHierarchy.h @@ -23,8 +23,10 @@ public: std::shared_ptr operator[](size_t pos) const; size_t size() const; - std::string getFullName() const; - std::string getName() const; + std::string getQualifiedName() const; + std::string getQualifiedNameWithSignature() const; + std::string getRawName() const; + std::string getRawNameWithSignature() const; private: std::vector> m_elements; diff --git a/src/lib/data/parser/ParseFunction.cpp b/src/lib/data/parser/ParseFunction.cpp index ad3dd9e3..14cbd79a 100644 --- a/src/lib/data/parser/ParseFunction.cpp +++ b/src/lib/data/parser/ParseFunction.cpp @@ -19,5 +19,5 @@ ParseFunction::ParseFunction( std::string ParseFunction::getFullName() const { - return nameHierarchy.getFullName(); + return nameHierarchy.getQualifiedNameWithSignature(); } diff --git a/src/lib/data/parser/ParseVariable.cpp b/src/lib/data/parser/ParseVariable.cpp index 2ba5b03e..72ebe998 100644 --- a/src/lib/data/parser/ParseVariable.cpp +++ b/src/lib/data/parser/ParseVariable.cpp @@ -11,5 +11,5 @@ ParseVariable::ParseVariable(const ParseTypeUsage& type, const NameHierarchy& na std::string ParseVariable::getFullName() const { - return nameHierarchy.getFullName(); + return nameHierarchy.getQualifiedNameWithSignature(); } diff --git a/src/lib/data/parser/ParserClient.cpp b/src/lib/data/parser/ParserClient.cpp index 3fd0f637..98e75333 100644 --- a/src/lib/data/parser/ParserClient.cpp +++ b/src/lib/data/parser/ParserClient.cpp @@ -107,9 +107,10 @@ std::string ParserClient::parameterStr(const std::vector paramet std::string ParserClient::functionStr(const ParseFunction& function) { - std::string str = + /*std::string str = function.returnType.dataType->getFullTypeName() + " " + function.getFullName() + parameterStr(function.parameters); - return addConstPrefix(addStaticPrefix(str, function.isStatic), function.isConst, false); + return addConstPrefix(addStaticPrefix(str, function.isStatic), function.isConst, false);*/ + return function.nameHierarchy.getQualifiedNameWithSignature(); } ParserClient::ParserClient() diff --git a/src/lib/data/parser/ParserClient.h b/src/lib/data/parser/ParserClient.h index b2a391d8..bdee54c0 100644 --- a/src/lib/data/parser/ParserClient.h +++ b/src/lib/data/parser/ParserClient.h @@ -58,35 +58,30 @@ public: virtual void startParsing() = 0; virtual void finishParsing() = 0; - virtual void prepareParsingFile(const FilePath& filePath) = 0; + virtual void startParsingFile(const FilePath& filePath) = 0; virtual void finishParsingFile(const FilePath& filePath) = 0; virtual void onError(const ParseLocation& location, const std::string& message) = 0; virtual size_t getErrorCount() const = 0; virtual Id onTypedefParsed( - const ParseLocation& location, const NameHierarchy& nameHierarchy, - const ParseTypeUsage& underlyingType, AccessType access) = 0; + const ParseLocation& location, const NameHierarchy& typedefName, AccessType access) = 0; virtual Id onClassParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation) = 0; virtual Id onStructParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation) = 0; - - virtual Id onGlobalVariableParsed(const ParseLocation& location, const ParseVariable& variable) = 0; - virtual Id onFieldParsed(const ParseLocation& location, const ParseVariable& variable, AccessType access) = 0; - + virtual Id onGlobalVariableParsed(const ParseLocation& location, const NameHierarchy& variable) = 0; + virtual Id onFieldParsed(const ParseLocation& location, const NameHierarchy& field, AccessType access) = 0; virtual Id onFunctionParsed( - const ParseLocation& location, const ParseFunction& function, const ParseLocation& scopeLocation) = 0; + const ParseLocation& location, const NameHierarchy& function, const ParseLocation& scopeLocation) = 0; virtual Id onMethodParsed( - const ParseLocation& location, const ParseFunction& method, AccessType access, AbstractionType abstraction, + const ParseLocation& location, const NameHierarchy& method, AccessType access, AbstractionType abstraction, const ParseLocation& scopeLocation) = 0; - virtual Id onNamespaceParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, const ParseLocation& scopeLocation) = 0; - virtual Id onEnumParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation) = 0; @@ -96,48 +91,30 @@ public: const ParseLocation& location, const NameHierarchy& nameHierarchy, const NameHierarchy& baseNameHierarchy, AccessType access) = 0; virtual Id onMethodOverrideParsed( - const ParseLocation& location, const ParseFunction& base, const ParseFunction& overrider) = 0; + const ParseLocation& location, const NameHierarchy& overridden, const NameHierarchy& overrider) = 0; virtual Id onCallParsed( - const ParseLocation& location, const ParseFunction& caller, const ParseFunction& callee) = 0; - virtual Id onCallParsed( - const ParseLocation& location, const ParseVariable& caller, const ParseFunction& callee) = 0; + const ParseLocation& location, const NameHierarchy& caller, const NameHierarchy& callee) = 0; virtual Id onFieldUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy) = 0; - virtual Id onFieldUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy) = 0; + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy) = 0; virtual Id onGlobalVariableUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy) = 0; - virtual Id onGlobalVariableUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy) = 0; + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy) = 0; virtual Id onEnumConstantUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy) = 0; - virtual Id onEnumConstantUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy) = 0; - virtual Id onTypeUsageParsed(const ParseTypeUsage& type, const ParseFunction& function) = 0; - virtual Id onTypeUsageParsed(const ParseTypeUsage& type, const ParseVariable& variable) = 0; + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy) = 0; + virtual Id onTypeUsageParsed(const ParseLocation& location, const NameHierarchy& user, const NameHierarchy& used) = 0; - virtual Id onTemplateArgumentTypeOfTemplateRecordParsed( + virtual Id onTemplateArgumentTypeParsed( const ParseLocation& location, const NameHierarchy& argumentTypeNameHierarchy, const NameHierarchy& templateNameHierarchy) = 0; - virtual Id onTemplateArgumentTypeOfTemplateFunctionParsed( - const ParseLocation& location, const NameHierarchy& argumentTypeNameHierarchy, - const ParseFunction& templateFunction) = 0; virtual Id onTemplateDefaultArgumentTypeParsed( - const ParseTypeUsage& type, const NameHierarchy& templateArgumentTypeNameHierarchy) = 0; - virtual Id onTemplateRecordParameterTypeParsed( - const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy, - const NameHierarchy& templateRecordNameHierarchy) = 0; - virtual Id onTemplateRecordSpecializationParsed( - const ParseLocation& location, const NameHierarchy& specializedRecordNameHierarchy, - const RecordType specializedRecordType, const NameHierarchy& specializedFromNameHierarchy) = 0; + const ParseLocation& location, const NameHierarchy& defaultArgumentTypeNameHierarchy, + const NameHierarchy& templateArgumentTypeNameHierarchy) = 0; + virtual Id onTemplateParameterTypeParsed( + const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy) = 0; + virtual Id onTemplateSpecializationParsed( + const ParseLocation& location, const NameHierarchy& specializedNameHierarchy, + const NameHierarchy& specializedFromNameHierarchy) = 0; virtual Id onTemplateMemberFunctionSpecializationParsed( - const ParseLocation& location, const ParseFunction& instantiatedFunction, const ParseFunction& specializedFunction) = 0; - - virtual Id onTemplateFunctionParameterTypeParsed( - const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy, - const ParseFunction function) = 0; - virtual Id onTemplateFunctionSpecializationParsed( - const ParseLocation& location, const ParseFunction specializedFunction, const ParseFunction templateFunction) = 0; + const ParseLocation& location, const NameHierarchy& instantiatedFunction, const NameHierarchy& specializedFunction) = 0; virtual Id onFileParsed(const FileInfo& fileInfo) = 0; virtual Id onFileIncludeParsed( diff --git a/src/lib/data/search/SearchIndex.cpp b/src/lib/data/search/SearchIndex.cpp index 39b865f2..2d3c6e48 100644 --- a/src/lib/data/search/SearchIndex.cpp +++ b/src/lib/data/search/SearchIndex.cpp @@ -68,7 +68,7 @@ SearchNode* SearchIndex::addNode(NameHierarchy nameHierarchy) std::deque nameIds; for (size_t i = 0; i < nameHierarchy.size(); i++) { - nameIds.push_back(m_dictionary.getWordId(nameHierarchy[i]->getFullName())); + nameIds.push_back(m_dictionary.getWordId(nameHierarchy[i]->getName())); } if (nameIds.size()) diff --git a/src/lib/data/search/SearchMatch.cpp b/src/lib/data/search/SearchMatch.cpp index d30d80a3..9869391d 100644 --- a/src/lib/data/search/SearchMatch.cpp +++ b/src/lib/data/search/SearchMatch.cpp @@ -87,7 +87,7 @@ bool SearchMatch::isValid() const void SearchMatch::print(std::ostream& ostream) const { - ostream << weight << '\t' << nameHierarchy.getFullName() << std::endl << '\t'; + ostream << weight << '\t' << nameHierarchy.getQualifiedName() << std::endl << '\t'; size_t i = 0; for (size_t index : indices) { @@ -104,7 +104,7 @@ void SearchMatch::print(std::ostream& ostream) const std::string SearchMatch::getFullName() const { - return nameHierarchy.getFullName(); + return nameHierarchy.getQualifiedName(); } std::string SearchMatch::getNodeTypeAsString() const diff --git a/src/lib/data/type/NamedDataType.cpp b/src/lib/data/type/NamedDataType.cpp index ae869ec9..82f92b8f 100644 --- a/src/lib/data/type/NamedDataType.cpp +++ b/src/lib/data/type/NamedDataType.cpp @@ -20,7 +20,7 @@ std::string NamedDataType::getFullTypeName() const std::string NamedDataType::getRawTypeName() const { - return m_nameHierarchy.getFullName(); + return m_nameHierarchy.getQualifiedNameWithSignature(); } const NameHierarchy& NamedDataType::getTypeNameHierarchy() const diff --git a/src/lib/utility/ScopedSwitcher.h b/src/lib/utility/ScopedSwitcher.h new file mode 100644 index 00000000..defed386 --- /dev/null +++ b/src/lib/utility/ScopedSwitcher.h @@ -0,0 +1,30 @@ +#ifndef SCOPED_SWITCHER_H +#define SCOPED_SWITCHER_H + +template +class ScopedSwitcher +{ +public: + ScopedSwitcher(T &var) + : m_var(&var) + , m_origVal(var) + {} + + ScopedSwitcher(T &var, T tempVal) + : m_var(&var) + , m_origVal(var) + { + var = tempVal; + } + + ~ScopedSwitcher() + { + *m_var = m_origVal; + } + +private: + T *m_var; + T m_origVal; +}; + +#endif // SCOPED_SWITCHER_H diff --git a/src/lib/utility/messaging/type/MessageActivateEdge.h b/src/lib/utility/messaging/type/MessageActivateEdge.h index 1482b724..a22ddec9 100644 --- a/src/lib/utility/messaging/type/MessageActivateEdge.h +++ b/src/lib/utility/messaging/type/MessageActivateEdge.h @@ -32,7 +32,7 @@ public: std::string getFullName() const { - return Edge::getTypeString(type) + ":" + fromNameHierarchy.getFullName() + "->" + toNameHierarchy.getFullName(); + return Edge::getTypeString(type) + ":" + fromNameHierarchy.getQualifiedNameWithSignature() + "->" + toNameHierarchy.getQualifiedNameWithSignature(); } virtual void print(std::ostream& os) const diff --git a/src/lib/utility/text/Dictionary.cpp b/src/lib/utility/text/Dictionary.cpp index 6de3b7c0..5eff15ba 100644 --- a/src/lib/utility/text/Dictionary.cpp +++ b/src/lib/utility/text/Dictionary.cpp @@ -91,7 +91,7 @@ std::deque Dictionary::getWordIdsConst(const NameHierarchy& nameHierarchy) c for (size_t i = 0; i < nameHierarchy.size(); i++) { - ids.push_back(getWordIdConst(nameHierarchy[i]->getFullName())); + ids.push_back(getWordIdConst(nameHierarchy[i]->getName())); } return ids; diff --git a/src/lib_parser/CMakeLists.txt b/src/lib_parser/CMakeLists.txt index 0dfa29c1..d82a617b 100644 --- a/src/lib_parser/CMakeLists.txt +++ b/src/lib_parser/CMakeLists.txt @@ -15,10 +15,6 @@ add_files( data/parser/cxx/ASTAction.h data/parser/cxx/ASTActionFactory.cpp data/parser/cxx/ASTActionFactory.h - data/parser/cxx/ASTBodyVisitor.cpp - data/parser/cxx/ASTBodyVisitor.h - data/parser/cxx/ASTBodyVisitorClient.cpp - data/parser/cxx/ASTBodyVisitorClient.h data/parser/cxx/ASTConsumer.cpp data/parser/cxx/ASTConsumer.h data/parser/cxx/ASTVisitor.cpp diff --git a/src/lib_parser/data/parser/cxx/ASTAction.cpp b/src/lib_parser/data/parser/cxx/ASTAction.cpp index 0ae2509d..e927b9fe 100644 --- a/src/lib_parser/data/parser/cxx/ASTAction.cpp +++ b/src/lib_parser/data/parser/cxx/ASTAction.cpp @@ -18,7 +18,7 @@ ASTAction::~ASTAction() std::unique_ptr ASTAction::CreateASTConsumer(clang::CompilerInstance& compiler, llvm::StringRef inFile) { - return std::unique_ptr(new ASTConsumer(&compiler.getASTContext(), m_client, m_fileRegister)); + return std::unique_ptr(new ASTConsumer(&compiler.getASTContext(), &compiler.getPreprocessor(), m_client, m_fileRegister)); } bool ASTAction::BeginSourceFileAction(clang::CompilerInstance& compiler, llvm::StringRef filePath) diff --git a/src/lib_parser/data/parser/cxx/ASTBodyVisitor.cpp b/src/lib_parser/data/parser/cxx/ASTBodyVisitor.cpp deleted file mode 100644 index bf665c4a..00000000 --- a/src/lib_parser/data/parser/cxx/ASTBodyVisitor.cpp +++ /dev/null @@ -1,177 +0,0 @@ -#include "data/parser/cxx/ASTBodyVisitor.h" - -#include "clang/AST/DeclCXX.h" - -ASTBodyVisitor::ASTBodyVisitor(ASTBodyVisitorClient* client, clang::FunctionDecl* functionDecl) - : m_client(client) - , m_functionDecl(functionDecl) - , m_varDecl(nullptr) -{ -} - -ASTBodyVisitor::ASTBodyVisitor(ASTBodyVisitorClient* client, clang::DeclaratorDecl* varDecl) - : m_client(client) - , m_functionDecl(nullptr) - , m_varDecl(varDecl) -{ -} - -ASTBodyVisitor::~ASTBodyVisitor() -{ -} - -void ASTBodyVisitor::VisitStmt(clang::Stmt* stmt) -{ - VisitChildren(stmt); -} - -void ASTBodyVisitor::VisitChildren(clang::Stmt* stmt) -{ - for (clang::Stmt::child_iterator it = stmt->child_begin(); it != stmt->child_end(); it++) - { - if (*it) - { - static_cast(this)->Visit(*it); - } - } -} - -void ASTBodyVisitor::VisitCallExpr(clang::CallExpr* expr) -{ - if (m_functionDecl) - { - m_client->VisitCallExprInDeclBody(m_functionDecl, expr); - } - else - { - m_client->VisitCallExprInDeclBody(m_varDecl, expr); - } - - VisitStmt(expr); -} - -void ASTBodyVisitor::VisitCXXConstructExpr(clang::CXXConstructExpr* expr) -{ - if (m_functionDecl) - { - m_client->VisitCXXConstructExprInDeclBody(m_functionDecl, expr); - } - else - { - m_client->VisitCXXConstructExprInDeclBody(m_varDecl, expr); - } - - VisitStmt(expr); -} - -void ASTBodyVisitor::VisitExplicitCastExpr(clang::ExplicitCastExpr* expr) -{ - if (m_functionDecl) - { - m_client->VisitExplicitCastExprInDeclBody(m_functionDecl, expr); - } - else - { - m_client->VisitExplicitCastExprInDeclBody(m_varDecl, expr); - } - - VisitStmt(expr); -} - -void ASTBodyVisitor::VisitCXXTemporaryObjectExpr(clang::CXXTemporaryObjectExpr* expr) -{ - if (m_functionDecl) - { - m_client->VisitCXXTemporaryObjectExprInDeclBody(m_functionDecl, expr); - } - else - { - m_client->VisitCXXTemporaryObjectExprInDeclBody(m_varDecl, expr); - } - - VisitStmt(expr); -} - -void ASTBodyVisitor::VisitCXXNewExpr(clang::CXXNewExpr* expr) -{ - if (m_functionDecl) - { - m_client->VisitCXXNewExprInDeclBody(m_functionDecl, expr); - } - else - { - m_client->VisitCXXNewExprInDeclBody(m_varDecl, expr); - } - - VisitStmt(expr); -} - -void ASTBodyVisitor::VisitMemberExpr(clang::make_ptr::type expr) -{ - if (expr->getMemberDecl()->getKind() == clang::Decl::Kind::Field) - { - if(m_functionDecl) - { - m_client->VisitMemberExprInDeclBody(m_functionDecl, expr); - } - else - { - m_client->VisitMemberExprInDeclBody(m_varDecl, expr); - } - } - VisitStmt(expr); -} - -void ASTBodyVisitor::VisitDeclRefExpr(clang::DeclRefExpr* expr) -{ - if (m_functionDecl) - { - m_client->VisitDeclRefExprInDeclBody(m_functionDecl, expr); - } - else - { - m_client->VisitDeclRefExprInDeclBody(m_varDecl, expr); - } - - if (expr->getDecl()->getKind() == clang::Decl::Var && expr->getDecl()->isDefinedOutsideFunctionOrMethod()) - { - if (m_functionDecl) - { - m_client->VisitGlobalVariableExprInDeclBody(m_functionDecl, expr); - } - else - { - m_client->VisitGlobalVariableExprInDeclBody(m_varDecl, expr); - } - } - else if (expr->getDecl()->getKind() == clang::Decl::EnumConstant) - { - if (m_functionDecl) - { - m_client->VisitEnumExprInDeclBody(m_functionDecl, expr); - } - else - { - m_client->VisitEnumExprInDeclBody(m_varDecl, expr); - } - } - - VisitStmt(expr); -} - -void ASTBodyVisitor::VisitLambdaExpr(clang::LambdaExpr* expr) -{ - // Don't visit the lambda's children. The ASTVisitor creates a new ASTBodyVisitor for these. -} - -void ASTBodyVisitor::VisitDeclStmt(clang::DeclStmt* stmt) -{ - for (clang::Decl* decl : stmt->decls()) - { - if (clang::isa(decl)) - { - m_client->VisitVarDeclInDeclBody(m_functionDecl, clang::dyn_cast(decl)); - } - } - VisitStmt(stmt); -} diff --git a/src/lib_parser/data/parser/cxx/ASTBodyVisitor.h b/src/lib_parser/data/parser/cxx/ASTBodyVisitor.h deleted file mode 100644 index 2e97c49d..00000000 --- a/src/lib_parser/data/parser/cxx/ASTBodyVisitor.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef AST_BODY_VISITOR -#define AST_BODY_VISITOR - -#include "clang/AST/StmtVisitor.h" -#include "data/parser/cxx/ASTBodyVisitorClient.h" - -class ASTBodyVisitor: public clang::StmtVisitor -{ -public: - ASTBodyVisitor(ASTBodyVisitorClient* client, clang::FunctionDecl* functionDecl); - ASTBodyVisitor(ASTBodyVisitorClient* client, clang::DeclaratorDecl* varDecl); - virtual ~ASTBodyVisitor(); - - void VisitStmt(clang::Stmt* stmt); - void VisitChildren(clang::Stmt* stmt); - void VisitCallExpr(clang::CallExpr* expr); - void VisitCXXConstructExpr(clang::CXXConstructExpr* expr); - void VisitExplicitCastExpr(clang::ExplicitCastExpr* expr); - void VisitCXXTemporaryObjectExpr(clang::CXXTemporaryObjectExpr* expr); - void VisitCXXNewExpr(clang::CXXNewExpr* expr); - void VisitMemberExpr(clang::make_ptr::type expr); - void VisitDeclRefExpr(clang::make_ptr::type expr); - void VisitLambdaExpr(clang::LambdaExpr* expr); - void VisitDeclStmt(clang::DeclStmt* stmt); - -private: - ASTBodyVisitorClient* m_client; - clang::FunctionDecl* m_functionDecl; - clang::DeclaratorDecl* m_varDecl; -}; - -#endif // AST_BODY_VISITOR diff --git a/src/lib_parser/data/parser/cxx/ASTBodyVisitorClient.cpp b/src/lib_parser/data/parser/cxx/ASTBodyVisitorClient.cpp deleted file mode 100644 index cc51496e..00000000 --- a/src/lib_parser/data/parser/cxx/ASTBodyVisitorClient.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "data/parser/cxx/ASTBodyVisitorClient.h" - -ASTBodyVisitorClient::ASTBodyVisitorClient() -{ -} - -ASTBodyVisitorClient::~ASTBodyVisitorClient() -{ -} diff --git a/src/lib_parser/data/parser/cxx/ASTBodyVisitorClient.h b/src/lib_parser/data/parser/cxx/ASTBodyVisitorClient.h deleted file mode 100644 index 21dd6d90..00000000 --- a/src/lib_parser/data/parser/cxx/ASTBodyVisitorClient.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef AST_BODY_VISITOR_CLIENT_H -#define AST_BODY_VISITOR_CLIENT_H - -#include "clang/AST/Decl.h" -#include "clang/AST/Expr.h" -#include "clang/AST/ExprCXX.h" - -class ASTBodyVisitorClient -{ -public: - ASTBodyVisitorClient(); - virtual ~ASTBodyVisitorClient(); - - virtual void VisitCallExprInDeclBody(clang::FunctionDecl* decl, clang::CallExpr* expr) = 0; - virtual void VisitCallExprInDeclBody(clang::DeclaratorDecl* decl, clang::CallExpr* expr) = 0; - virtual void VisitDeclRefExprInDeclBody(clang::FunctionDecl* decl, clang::DeclRefExpr* expr) = 0; - virtual void VisitDeclRefExprInDeclBody(clang::DeclaratorDecl* decl, clang::DeclRefExpr* expr) = 0; - virtual void VisitCXXConstructExprInDeclBody(clang::FunctionDecl* decl, clang::CXXConstructExpr* expr) = 0; - virtual void VisitCXXConstructExprInDeclBody(clang::DeclaratorDecl* decl, clang::CXXConstructExpr* expr) = 0; - virtual void VisitExplicitCastExprInDeclBody(clang::FunctionDecl* decl, clang::ExplicitCastExpr* expr) = 0; - virtual void VisitExplicitCastExprInDeclBody(clang::DeclaratorDecl* decl, clang::ExplicitCastExpr* expr) = 0; - virtual void VisitCXXTemporaryObjectExprInDeclBody(clang::FunctionDecl* decl, clang::CXXTemporaryObjectExpr* expr) = 0; - virtual void VisitCXXTemporaryObjectExprInDeclBody(clang::DeclaratorDecl* decl, clang::CXXTemporaryObjectExpr* expr) = 0; - virtual void VisitCXXNewExprInDeclBody(clang::FunctionDecl* decl, clang::CXXNewExpr* expr) = 0; - virtual void VisitCXXNewExprInDeclBody(clang::DeclaratorDecl* decl, clang::CXXNewExpr* expr) = 0; - virtual void VisitMemberExprInDeclBody(clang::FunctionDecl* decl, clang::MemberExpr* expr) = 0; - virtual void VisitMemberExprInDeclBody(clang::DeclaratorDecl* decl, clang::MemberExpr* expr) = 0; - virtual void VisitGlobalVariableExprInDeclBody(clang::FunctionDecl* decl, clang::DeclRefExpr* expr) = 0; - virtual void VisitGlobalVariableExprInDeclBody(clang::DeclaratorDecl* decl, clang::DeclRefExpr* expr) = 0; - virtual void VisitEnumExprInDeclBody(clang::FunctionDecl* decl, clang::DeclRefExpr* expr) = 0; - virtual void VisitEnumExprInDeclBody(clang::DeclaratorDecl* decl, clang::DeclRefExpr* expr) = 0; - virtual void VisitVarDeclInDeclBody(clang::FunctionDecl* decl, clang::VarDecl* varDecl) = 0; -}; - -#endif // AST_BODY_VISITOR_CLIENT_H diff --git a/src/lib_parser/data/parser/cxx/ASTConsumer.cpp b/src/lib_parser/data/parser/cxx/ASTConsumer.cpp index cea87be9..0c99ab53 100644 --- a/src/lib_parser/data/parser/cxx/ASTConsumer.cpp +++ b/src/lib_parser/data/parser/cxx/ASTConsumer.cpp @@ -2,8 +2,8 @@ #include "data/parser/ParserClient.h" -ASTConsumer::ASTConsumer(clang::ASTContext* context, ParserClient* client, FileRegister* fileRegister) - : m_visitor(context, client, fileRegister) +ASTConsumer::ASTConsumer(clang::ASTContext* context, clang::Preprocessor* preprocessor, ParserClient* client, FileRegister* fileRegister) + : m_visitor(context, preprocessor, client, fileRegister) { } @@ -13,5 +13,5 @@ ASTConsumer::~ASTConsumer() void ASTConsumer::HandleTranslationUnit(clang::ASTContext& context) { - m_visitor.TraverseDecl(context.getTranslationUnitDecl()); + m_visitor.indexDecl(context.getTranslationUnitDecl()); } diff --git a/src/lib_parser/data/parser/cxx/ASTConsumer.h b/src/lib_parser/data/parser/cxx/ASTConsumer.h index 593420e8..ea9e05fc 100644 --- a/src/lib_parser/data/parser/cxx/ASTConsumer.h +++ b/src/lib_parser/data/parser/cxx/ASTConsumer.h @@ -12,7 +12,7 @@ class ASTConsumer : public clang::ASTConsumer { public: - explicit ASTConsumer(clang::ASTContext* context, ParserClient* client, FileRegister* fileRegister); + explicit ASTConsumer(clang::ASTContext* context, clang::Preprocessor* preprocessor, ParserClient* client, FileRegister* fileRegister); virtual ~ASTConsumer(); virtual void HandleTranslationUnit(clang::ASTContext& context); diff --git a/src/lib_parser/data/parser/cxx/ASTVisitor.cpp b/src/lib_parser/data/parser/cxx/ASTVisitor.cpp index b352e370..71bd9a75 100644 --- a/src/lib_parser/data/parser/cxx/ASTVisitor.cpp +++ b/src/lib_parser/data/parser/cxx/ASTVisitor.cpp @@ -1,893 +1,1454 @@ #include "data/parser/cxx/ASTVisitor.h" -#include -#include +#include +#include +#include +#include +#include +#include "data/parser/cxx/utilityCxx.h" #include "utility/file/FileManager.h" #include "utility/file/FileSystem.h" -#include "utility/logging/logging.h" -#include "utility/utilityString.h" +#include "utility/ScopedSwitcher.h" -#include "data/parser/cxx/ASTBodyVisitor.h" -#include "data/parser/cxx/name_resolver/CxxDeclNameResolver.h" -#include "data/parser/cxx/name_resolver/CxxTemplateArgumentNameResolver.h" -#include "data/parser/cxx/utilityCxx.h" -#include "data/parser/ParseFunction.h" -#include "data/parser/ParseLocation.h" -#include "data/parser/ParseTypeUsage.h" -#include "data/parser/ParseVariable.h" -#include "data/type/DataType.h" -#include "data/type/NamedDataType.h" -ASTVisitor::ASTVisitor(clang::ASTContext* context, ParserClient* client, FileRegister* fileRegister) +// TODO: For an array access, X[I], skip over the array-to-pointer decay. We +// currently record that X's address is taken, which is technically true, but +// the address does not generally escape. + +// TODO: A struct assignment in C++ turns into an operator= call, even if the +// user did not define an operator= function. Consider handling operator= +// calls the same way that normal assignment operations are handled. Consider +// doing the same for the other overloadable operators. + +// TODO: Unary ++ and -- +// TODO: Fix local extern variables. e.g. void func() { extern int var; } +// Consider extern "C", functions nested within classes or namespaces. + +/////////////////////////////////////////////////////////////////////////////// +// Misc routines + +ASTVisitor::ASTVisitor(clang::ASTContext* context, clang::Preprocessor* preprocessor, ParserClient* client, FileRegister* fileRegister) : m_context(context) + , m_preprocessor(preprocessor) , m_client(client) , m_fileRegister(fileRegister) + , m_thisContext(0) + , m_childContext(0) + , m_typeContext(RT_Reference) + , m_contextAccess(ParserClient::ACCESS_NONE) { + m_declNameCache = std::make_shared(); + m_typeNameCache = std::make_shared(); + m_contextNameGenerator = std::make_shared(nullptr, m_declNameCache); + m_childContextNameGenerator = std::make_shared(nullptr, m_declNameCache); } -ASTVisitor::~ASTVisitor() -{ -} - -bool ASTVisitor::VisitStmt(const clang::Stmt* statement) +bool ASTVisitor::VisitTranslationUnitDecl(clang::TranslationUnitDecl* decl) { + //decl->dump(); return true; } -bool ASTVisitor::VisitTypedefDecl(clang::TypedefDecl* declaration) +bool ASTVisitor::shouldUseDataRecursionFor(clang::Stmt *s) const { - if (isLocatedInUnparsedProjectFile(declaration)) + if (s == NULL || !base::shouldUseDataRecursionFor(s)) + return false; + if (clang::UnaryOperator *e = llvm::dyn_cast(s)) { + return e->getOpcode() >= clang::UO_Plus && + e->getOpcode() <= clang::UO_Imag; + } + if (clang::BinaryOperator *e = llvm::dyn_cast(s)) { + return e->getOpcode() >= clang::BO_Mul && + e->getOpcode() <= clang::BO_LOr; + } + return false; +} + + +/////////////////////////////////////////////////////////////////////////////// +// Dispatcher routines + +// Set the "this" context to the "child" context and reset the child context +// to default. + +bool ASTVisitor::TraverseStmt(clang::Stmt *stmt) +{ + if (stmt == NULL) + return true; + + ScopedSwitcher sw1(m_thisContext, m_childContext); + + if (clang::Expr *e = llvm::dyn_cast(stmt)) { + if (e->isRValue()) + m_thisContext &= ~(CF_AddressTaken | CF_Assigned | CF_Modified); + } else { + m_thisContext = 0; + } + + ScopedSwitcher sw2(m_childContext, m_thisContext); + + return base::TraverseStmt(stmt); +} + +bool ASTVisitor::TraverseType(clang::QualType t) +{ + ScopedSwitcher sw1(m_thisContext, 0); + ScopedSwitcher sw2(m_childContext, 0); + return base::TraverseType(t); +} + +bool ASTVisitor::TraverseTypeLoc(clang::TypeLoc tl) +{ + ScopedSwitcher sw1(m_thisContext, 0); + ScopedSwitcher sw2(m_childContext, 0); + return base::TraverseTypeLoc(tl); +} + +bool ASTVisitor::TraverseDecl(clang::Decl *d) +{ + ScopedSwitcher sw1(m_thisContext, 0); + ScopedSwitcher sw2(m_childContext, 0); + + std::shared_ptr>> sw3; + if (d && clang::isa(d) && clang::isa(d) && !clang::isa(d)) { - m_client->onTypedefParsed( - getParseLocationForNamedDecl(declaration), - getDeclNameHierarchy(declaration), - getParseTypeUsage(declaration->getTypeSourceInfo()->getTypeLoc(), declaration->getUnderlyingType()), - convertAccessType(declaration->getAccess()) - ); + clang::NamedDecl* nd = clang::dyn_cast(d); + sw3 = std::make_shared>>(m_contextNameGenerator, std::make_shared(nd, m_declNameCache)); } + return base::TraverseDecl(d); +} + +bool ASTVisitor::TraverseLambdaExpr(clang::LambdaExpr* e) +{ + ScopedSwitcher> switcher(m_contextNameGenerator, std::make_shared(e->getCallOperator(), m_declNameCache)); + return base::TraverseLambdaExpr(e); +} + +bool ASTVisitor::TraverseFunctionDecl(clang::FunctionDecl* d) +{ + ScopedSwitcher> switcher(m_childContextNameGenerator, std::make_shared(d, m_declNameCache)); // store context for template arguments of function specialitzation + return base::TraverseFunctionDecl(d); +} + +bool ASTVisitor::TraverseTypedefDecl(clang::TypedefDecl *d) +{ + ScopedSwitcher> switcher(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + return base::TraverseTypedefDecl(d); +} + +bool ASTVisitor::TraverseFieldDecl(clang::FieldDecl *d) +{ + ScopedSwitcher> switcher(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + return base::TraverseFieldDecl(d); +} + +bool ASTVisitor::TraverseVarDecl(clang::VarDecl *d) +{ + std::shared_ptr>> switcher; + + NameHierarchy contextNameHierarchy = m_contextNameGenerator->getName(); + if (!(contextNameHierarchy.size() > 0 && contextNameHierarchy.back()->hasSignature())) // TODO: optimize this: remove requirement to get the name here! + { + switcher = std::make_shared>>(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + } + return base::TraverseVarDecl(d); +} + +bool ASTVisitor::TraverseClassTemplateDecl(clang::ClassTemplateDecl* d) +{ + ScopedSwitcher> switcher(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + return base::TraverseClassTemplateDecl(d); +} + +bool ASTVisitor::TraverseTemplateTypeParmDecl(clang::TemplateTypeParmDecl* d) +{ + // same as base::TraverseTemplateTypeParmDecl(..) but we need to integrate the setter for the context info. + WalkUpFromTemplateTypeParmDecl(d); + + if (d->hasDefaultArgument() && !d->defaultArgumentWasInherited()) + { + ScopedSwitcher sw1(m_typeContext, RT_TemplateDefaultArgument); + ScopedSwitcher> sw2(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + TraverseTypeLoc(d->getDefaultArgumentInfo()->getTypeLoc()); + } + + traverseDeclContextHelper(clang::dyn_cast(d)); return true; } -bool ASTVisitor::VisitRecordDecl(clang::RecordDecl* declaration) +bool ASTVisitor::TraverseTemplateTemplateParmDecl(clang::TemplateTemplateParmDecl* d) { - if (isLocatedInUnparsedProjectFile(declaration)) + // same as base::TraverseTemplateTemplateParmDecl(..) but we need to integrate the setter for the context info. + WalkUpFromTemplateTemplateParmDecl(d); + + TraverseDecl(d->getTemplatedDecl()); + + if (d->hasDefaultArgument() && !d->defaultArgumentWasInherited()) { - if (declaration->isClass()) - { - m_client->onClassParsed( - getParseLocationForNamedDecl(declaration), - getDeclNameHierarchy(declaration), - convertAccessType(declaration->getAccess()), - getParseLocationOfRecordBody(declaration) - ); - } - else if (declaration->isStruct()) - { - m_client->onStructParsed( - getParseLocationForNamedDecl(declaration), - getDeclNameHierarchy(declaration), - convertAccessType(declaration->getAccess()), - getParseLocationOfRecordBody(declaration) - ); - } + ScopedSwitcher sw1(m_typeContext, RT_TemplateDefaultArgument); + ScopedSwitcher> sw2(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); - if ((declaration->isClass() || declaration->isStruct()) && - declaration->isThisDeclarationADefinition()) - { - if (clang::CXXRecordDecl* cxxDecl = clang::dyn_cast_or_null(declaration)) - { - for (const clang::CXXBaseSpecifier& it : cxxDecl->bases()) - { - m_client->onInheritanceParsed( - getParseLocation(it.getSourceRange()), - getDeclNameHierarchy(declaration), - utility::qualTypeToDataType(it.getType())->getTypeNameHierarchy(), - convertAccessType(it.getAccessSpecifier()) - ); + //d->getDefaultArgument + TraverseTemplateArgumentLoc(d->getDefaultArgument()); + } - // TODO: check for template class and add arguments! - } - } + clang::TemplateParameterList* TPL = d->getTemplateParameters(); + if (TPL) + { + for (clang::TemplateParameterList::iterator I = TPL->begin(), E = TPL->end(); I != E; ++I) + { + TraverseDecl(*I); } } + traverseDeclContextHelper(clang::dyn_cast(d)); return true; } -bool ASTVisitor::VisitVarDecl(clang::VarDecl* declaration) +bool ASTVisitor::TraverseClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl* d) { - // Abort on local variables and parameters. - if (declaration->isFunctionOrMethodVarDecl() || clang::isa(declaration)) + ScopedSwitcher> switcher(m_childContextNameGenerator, std::make_shared(d, m_declNameCache)); + return base::TraverseClassTemplatePartialSpecializationDecl(d); +} + +bool ASTVisitor::TraverseDeclRefExpr(clang::DeclRefExpr* e) +{ + ScopedSwitcher> switcher(m_childContextNameGenerator, std::make_shared(e->getDecl(), m_declNameCache)); + return base::TraverseDeclRefExpr(e); +} + +bool ASTVisitor::TraverseTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc loc) +{ + const clang::Type* t = loc.getTypePtr(); + ScopedSwitcher> switcher(m_childContextNameGenerator, std::make_shared(t, m_typeNameCache)); + return base::TraverseTemplateSpecializationTypeLoc(loc); +} + +bool ASTVisitor::TraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc) +{ + std::shared_ptr> sw1; + std::shared_ptr>> sw2; + + if (m_typeContext != RT_TemplateDefaultArgument) { - return true; + sw1 = std::make_shared>(m_typeContext, RT_TemplateArgument); + sw2 = std::make_shared>>(m_contextNameGenerator, m_childContextNameGenerator); } - if (isLocatedInUnparsedProjectFile(declaration)) + clang::TemplateArgument::ArgKind kk = loc.getArgument().getKind(); + if (kk == clang::TemplateArgument::Template) { - clang::AccessSpecifier access = declaration->getAccess(); + RecordDeclRef(loc.getArgument().getAsTemplate().getAsTemplateDecl(), loc.getLocation(), m_typeContext); + } + + return base::TraverseTemplateArgumentLoc(loc); +} - if (access == clang::AS_none) +//bool ASTVisitor::TraverseFunctionTemplateDecl(clang::FunctionTemplateDecl* d) +//{ +// ScopedSwitcher switcher(m_contextDecl, d); +// return base::TraverseFunctionTemplateDecl(d); +//} + +/////////////////////////////////////////////////////////////////////////////// +// Expression context propagation + +bool ASTVisitor::TraverseCallCommon(clang::CallExpr *call) +{ + { + m_childContext = CF_Called; + TraverseStmt(call->getCallee()); + } + for (unsigned int i = 0; i < call->getNumArgs(); ++i) { + clang::Expr *arg = call->getArg(i); + // If the child is really an lvalue, then this call is passing a + // reference. If the child is not an lvalue, then this address-taken + // flag will be masked out, and the rvalue will be assumed to be read. + m_childContext = CF_AddressTaken; + TraverseStmt(arg); + } + return true; +} + +bool ASTVisitor::TraverseBinComma(clang::BinaryOperator *s) +{ + { + m_childContext = 0; + TraverseStmt(s->getLHS()); + } + { + m_childContext = m_thisContext; + TraverseStmt(s->getRHS()); + } + return true; +} + +bool ASTVisitor::TraverseAssignCommon( + clang::BinaryOperator *e, + ContextFlags lhsFlag) +{ + { + m_childContext = m_thisContext | lhsFlag; + if (m_childContext & CF_Called) { + m_childContext ^= CF_Called; + m_childContext |= CF_Read; + } + TraverseStmt(e->getLHS()); + } + { + m_childContext = 0; + TraverseStmt(e->getRHS()); + } + return true; +} + +bool ASTVisitor::VisitCastExpr(clang::CastExpr *e) +{ + if (e->getCastKind() == clang::CK_ArrayToPointerDecay) { + // Note that e->getSubExpr() can be an rvalue array, in which case the + // CF_AddressTaken context will be masked away to 0. + m_childContext = CF_AddressTaken; + } else if (e->getCastKind() == clang::CK_ToVoid) { + m_childContext = 0; + } else if (e->getCastKind() == clang::CK_LValueToRValue) { + m_childContext = CF_Read; + } + return true; +} + +bool ASTVisitor::VisitUnaryAddrOf(clang::UnaryOperator *e) +{ + m_childContext = CF_AddressTaken; + return true; +} + +bool ASTVisitor::VisitUnaryDeref(clang::UnaryOperator *e) +{ + m_childContext = 0; + return true; +} + +bool ASTVisitor::VisitDeclStmt(clang::DeclStmt *s) +{ + // If a declaration is a reference to an lvalue initializer, then we + // record that that the initializer's address was taken. If it is + // an rvalue instead, then we'll see something else in the tree indicating + // what kind of reference to record (e.g. lval-to-rval cast, assignment, + // call, & operator) or assume the rvalue is being read. + m_childContext = CF_AddressTaken; + return true; +} + +bool ASTVisitor::VisitReturnStmt(clang::ReturnStmt *s) +{ + // See comment for VisitDeclStmt. + m_childContext = CF_AddressTaken; + return true; +} + +bool ASTVisitor::VisitVarDecl(clang::VarDecl *d) +{ + // See comment for VisitDeclStmt. Set the context for the variable's + // initializer. Also handle default arguments on parameter declarations. + m_childContext = CF_AddressTaken; + return true; +} + +bool ASTVisitor::VisitInitListExpr(clang::InitListExpr *e) +{ + // See comment for VisitDeclStmt. An initializer list can also bind + // references. + m_childContext = CF_AddressTaken; + return true; +} + +bool ASTVisitor::TraverseConstructorInitializer(clang::CXXCtorInitializer *init) +{ + if (init->getMember() != NULL) { + RecordDeclRef(init->getMember(), + init->getMemberLocation(), + RT_Initialized, + ST_Field); + } + + // See comment for VisitDeclStmt. + m_childContext = CF_AddressTaken; + return base::TraverseConstructorInitializer(init); +} + + +/////////////////////////////////////////////////////////////////////////////// +// Expression reference recording + +bool ASTVisitor::VisitLambdaExpr(clang::LambdaExpr* e) +{ + RecordDeclRef(e->getCallOperator(), e->getLocStart(), RT_Definition, ST_Function); + return true; +} + +bool ASTVisitor::VisitMemberExpr(clang::MemberExpr *e) +{ + RecordDeclRefExpr( + e->getMemberDecl(), + e->getMemberLoc(), + e, + m_thisContext); + + // Update the child context for the base sub-expression. + if (e->isArrow()) { + m_childContext = CF_Read; + } else { + m_childContext = 0; + if (m_thisContext & CF_AddressTaken) + m_childContext |= CF_AddressTaken; + if (m_thisContext & (CF_Assigned | CF_Modified)) + m_childContext |= CF_Modified; + if (m_thisContext & CF_Read) + m_childContext |= CF_Read; + if (m_thisContext & CF_Called) { + // I'm not sure what the best behavior here is. + m_childContext |= CF_Read; + } + } + + return true; +} + +bool ASTVisitor::VisitDeclRefExpr(clang::DeclRefExpr *e) +{ + RecordDeclRefExpr( + e->getDecl(), + e->getLocation(), + e, + m_thisContext); + return true; +} + +bool ASTVisitor::VisitCXXConstructExpr(clang::CXXConstructExpr *e) +{ + //if (e->getParenOrBraceRange().isValid()) { + // // XXX: This code is a kludge. Recording calls to constructors is + // // troublesome because there isn't an obvious location to associate the + // // call with. Consider: + // // A::A() : field(1, 2, 3) {} + // // new A(1, 2, 3) + // // struct A { A(B); }; A f() { B b; return b; } + // // Implicit calls to conversion operator methods pose a similar + // // problem. + // // + // // Recording constructor calls is very useful, though, so, as a + // // temporary measure, when there are constructor arguments surrounded + // // by parentheses, associate the call with the right parenthesis. + // // + // // Perhaps the right fix is to associate the call with the line itself + // // or with a larger span which may have other references nested within + // // it. The fix may have implications for the navigator GUI. + // RecordDeclRefExpr( + // e->getConstructor(), + // e->getParenOrBraceRange().getEnd(), + // e, + // CF_Called); + //} + clang::SourceLocation loc; + clang::SourceLocation braceBeginLoc = e->getParenOrBraceRange().getBegin(); + clang::SourceLocation nameBeginLoc = e->getSourceRange().getBegin(); + if (braceBeginLoc.isValid()) + { + if (braceBeginLoc == nameBeginLoc) { - m_client->onGlobalVariableParsed( - getParseLocationForNamedDecl(declaration), - getParseVariable(declaration) - ); - - if (declaration->getInit()) - { - ASTBodyVisitor bodyVisitor(this, declaration); - bodyVisitor.Visit(declaration->getInit()); - } + loc = nameBeginLoc; } else { - m_client->onFieldParsed( - getParseLocationForNamedDecl(declaration), - getParseVariable(declaration), - convertAccessType(declaration->getAccess()) - ); + loc = braceBeginLoc.getLocWithOffset(-1); + } + } + else + { + loc = e->getSourceRange().getEnd(); + } + loc = clang::Lexer::GetBeginningOfToken(loc, m_context->getSourceManager(), m_context->getLangOpts()); + RecordDeclRefExpr( + e->getConstructor(), + loc, + e, + CF_Called); + return true; +} + +void ASTVisitor::RecordDeclRefExpr(clang::NamedDecl *d, clang::SourceLocation loc, clang::Expr *e, Context context) +{ + SymbolType symbolType = ST_Max; + + if (clang::isa(d)) + { + if (llvm::isa(d)) + { + symbolType = ST_Parameter; + } + else if (d->getParentFunctionOrMethod() == NULL) + { + symbolType = ST_GlobalVariable; + } + else + { + symbolType = ST_LocalVariable; + } + } + if (clang::isa(d)) + { + symbolType = ST_Enumerator; + } + else if (clang::isa(d)) + { + symbolType = ST_Field; + } + + if (m_typeContext == RT_TemplateArgument) + { + RecordDeclRef(d, loc, m_typeContext, symbolType); + } + else + { + + if (llvm::isa(*d)) + { + // XXX: This code seems sloppy, but I suspect it will work well enough. + if (context & CF_Called) + RecordDeclRef(d, loc, RT_Called, symbolType); + if (!(context & CF_Called) || (context & (CF_Read | CF_AddressTaken))) + RecordDeclRef(d, loc, RT_AddressTaken, symbolType); + } + else + { + if (context & CF_Called) + RecordDeclRef(d, loc, RT_Called, symbolType); + if (context & CF_Read) + RecordDeclRef(d, loc, RT_Read, symbolType); + if (context & CF_AddressTaken) + RecordDeclRef(d, loc, RT_AddressTaken, symbolType); + if (context & CF_Assigned) + RecordDeclRef(d, loc, RT_Assigned, symbolType); + if (context & CF_Modified) + RecordDeclRef(d, loc, RT_Modified, symbolType); + if (context == 0) + RecordDeclRef(d, loc, e->isRValue() ? RT_Read : RT_Other, symbolType); + } + } +} + + +/////////////////////////////////////////////////////////////////////////////// +// NestedNameSpecifier handling + +bool ASTVisitor::TraverseNestedNameSpecifierLoc( + clang::NestedNameSpecifierLoc qualifier) +{ + for (; qualifier; qualifier = qualifier.getPrefix()) { + clang::NestedNameSpecifier *nns = qualifier.getNestedNameSpecifier(); + switch (nns->getKind()) { + case clang::NestedNameSpecifier::Namespace: + RecordDeclRef(nns->getAsNamespace(), + qualifier.getLocalBeginLoc(), + RT_Qualifier); + break; + case clang::NestedNameSpecifier::NamespaceAlias: + RecordDeclRef(nns->getAsNamespaceAlias(), + qualifier.getLocalBeginLoc(), + RT_Qualifier); + break; + case clang::NestedNameSpecifier::TypeSpec: + case clang::NestedNameSpecifier::TypeSpecWithTemplate: + if (const clang::TypedefType *tt = nns->getAsType()->getAs()) { + RecordDeclRef(tt->getDecl(), + qualifier.getLocalBeginLoc(), + RT_Qualifier); + } else if (const clang::RecordType *rt = nns->getAsType()->getAs()) { + RecordDeclRef(rt->getDecl(), + qualifier.getLocalBeginLoc(), + RT_Qualifier); + } else if (const clang::TemplateSpecializationType *tst = + nns->getAsType()->getAs()) { + + if (clang::TemplateDecl *decl = tst->getTemplateName().getAsTemplateDecl()) { + if (clang::NamedDecl *templatedDecl = decl->getTemplatedDecl()) { + RecordDeclRef(templatedDecl, + qualifier.getLocalBeginLoc(), + RT_Qualifier); + + } + } + } + break; + default: + // TODO: Do these cases matter? + break; + } + } + return true; +} + + +/////////////////////////////////////////////////////////////////////////////// +// Declaration and TypeLoc handling + +void ASTVisitor::traverseDeclContextHelper(clang::DeclContext *d) +{ + if (!d) + return; + + // Traverse children. + for (clang::DeclContext::decl_iterator it = d->decls_begin(), + itEnd = d->decls_end(); it != itEnd; ++it) { + // BlockDecls are traversed through BlockExprs. + if (!llvm::isa(*it)) + TraverseDecl(*it); + } +} + +// Overriding TraverseCXXRecordDecl lets us mark the base-class references +// with the "Base-Class" kind. +bool ASTVisitor::TraverseCXXRecordDecl(clang::CXXRecordDecl *d) +{ + // Traverse qualifiers on the record decl. + TraverseNestedNameSpecifierLoc(d->getQualifierLoc()); + + // Visit the TagDecl to record its ref. + WalkUpFromCXXRecordDecl(d); + + // Traverse base classes. + if (d->isThisDeclarationADefinition()) { + for (clang::CXXRecordDecl::base_class_iterator it = d->bases_begin(); + it != d->bases_end(); + ++it) { + clang::CXXBaseSpecifier *baseSpecifier = it; + ScopedSwitcher sw1(m_typeContext, RT_BaseClass); + ScopedSwitcher sw2(m_contextAccess, convertAccessType(baseSpecifier->getAccessSpecifier())); + ScopedSwitcher> sw3(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + TraverseTypeLoc(baseSpecifier->getTypeSourceInfo()->getTypeLoc()); + } + } + + traverseDeclContextHelper(d); + return true; +} + +bool ASTVisitor::TraverseClassTemplateSpecializationDecl( + clang::ClassTemplateSpecializationDecl *d) +{ + // base::TraverseClassTemplateSpecializationDecl calls TraverseTypeLoc, + // which then visits a clang::TemplateSpecializationTypeLoc. We want + // to mark the template specialization as Declaration or Definition, + // not Reference, so skip the TraverseTypeLoc call. + // + // The problem happens with code like this: + // template <> + // struct Vector {}; + + WalkUpFromClassTemplateSpecializationDecl(d); + + if (clang::TypeSourceInfo* tsi = d->getTypeAsWritten()) + { + ScopedSwitcher> switcher(m_childContextNameGenerator, std::make_shared(d, m_declNameCache)); + clang::TypeLoc tl = tsi->getTypeLoc(); + clang::TemplateSpecializationTypeLoc tstl = tl.castAs(); + for (unsigned I = 0, E = tstl.getNumArgs(); I != E; ++I) + { + TraverseTemplateArgumentLoc(tstl.getArgLoc(I)); } } - return true; + traverseDeclContextHelper(d); + + + + return true; + //base::TraverseClassTemplateSpecializationDecl(d); } -bool ASTVisitor::VisitFieldDecl(clang::FieldDecl* declaration) +bool ASTVisitor::TraverseNamespaceAliasDecl(clang::NamespaceAliasDecl *d) { - if (isLocatedInUnparsedProjectFile(declaration)) - { - if (declaration->hasInClassInitializer()) - { - ASTBodyVisitor bodyVisitor(this, declaration); - bodyVisitor.Visit(declaration->getInClassInitializer()); - } - m_client->onFieldParsed( - getParseLocationForNamedDecl(declaration), - getParseVariable(declaration), - convertAccessType(declaration->getAccess()) - ); - } + // The base::TraverseNamespaceAliasDecl function avoids traversing the + // namespace decl itself because (I think) that would traverse the + // complete contents of the namespace. However, it fails to traverse + // the qualifiers on the target namespace, so we do that here. + TraverseNestedNameSpecifierLoc(d->getQualifierLoc()); - return true; + return base::TraverseNamespaceAliasDecl(d); } -bool ASTVisitor::VisitFunctionDecl(clang::FunctionDecl* declaration) +void ASTVisitor::templateParameterListsHelper(clang::DeclaratorDecl *d) { - // Abort for CXXMethodDecls to avoid duplicate call. - if (clang::isa(declaration)) - { - return true; - } - - if (isLocatedInUnparsedProjectFile(declaration)) - { - processFunctionDecl(declaration); - } - - return true; + for (unsigned i = 0, iEnd = d->getNumTemplateParameterLists(); + i != iEnd; ++i) { + clang::TemplateParameterList *parmList = + d->getTemplateParameterList(i); + for (clang::NamedDecl *parm : *parmList) + TraverseDecl(parm); + } } -bool ASTVisitor::VisitLambdaExpr(clang::LambdaExpr* expr) +bool ASTVisitor::VisitDecl(clang::Decl *d) { - if (isLocatedInUnparsedProjectFile(expr->getCallOperator())) - { - processFunctionDecl(expr->getCallOperator()); - } - return true; -} - -bool ASTVisitor::VisitParmVarDecl(clang::ParmVarDecl* declaration) -{ - // todo: handle parameters here! - // maybe handle template args in visitvardecl to account for local variables and stuff... - processTemplateArguments(declaration->getTypeSourceInfo()->getTypeLoc()); - - return true; -} - -bool ASTVisitor::VisitCXXMethodDecl(clang::CXXMethodDecl* declaration) -{ - if (isLocatedInUnparsedProjectFile(declaration)) - { - ParseFunction parseFunction = getParseFunction(declaration); - ParseLocation location = getParseLocationForNamedDecl(declaration); - - m_client->onMethodParsed( - location, - parseFunction, - convertAccessType(declaration->getAccess()), - getAbstractionType(declaration), - getParseLocationOfFunctionBody(declaration) - ); - - for (clang::CXXMethodDecl::method_iterator it = declaration->begin_overridden_methods(); - it != declaration->end_overridden_methods(); it++) - { - m_client->onMethodOverrideParsed(location, getParseFunction(*it), parseFunction); - } - - if (declaration->hasBody() && declaration->getBody() != NULL && declaration->isThisDeclarationADefinition() && - !declaration->isDependentContext()) - { - ASTBodyVisitor bodyVisitor(this, declaration); - bodyVisitor.Visit(declaration->getBody()); - } - } - - return true; -} - -bool ASTVisitor::VisitCXXConstructorDecl(clang::CXXConstructorDecl* declaration) -{ - if (isLocatedInUnparsedProjectFile(declaration)) - { - for (clang::CXXConstructorDecl::init_const_iterator it = declaration->init_begin(); it != declaration->init_end(); it++) - { - if ((*it)->getInit()) - { - clang::CXXCtorInitializer* init = *it; - - if (init->isMemberInitializer()) + if (clang::NamedDecl *nd = llvm::dyn_cast(d)) { + clang::SourceLocation loc = nd->getLocation(); + if (clang::FunctionDecl *fd = llvm::dyn_cast(d)) { + //if (fd->getTemplateInstantiationPattern() != NULL) { + // // When Clang instantiates a function template, it seems to + // // create a FunctionDecl for the instantiation that returns + // // false for fd->isThisDeclarationADefinition(). The result + // // is that the template function definition's location is + // // marked as both a Declaration and a Definition. Fix this by + // // omitting the ref on the instantiation. + //} else { +#if 0 + // This code recorded refs without appropriate qualifiers. For + // example, with the code + // template void Vector::clear() {} + // it would record the first A as "A", but it needs to record + // Vector::A. + templateParameterListsHelper(fd); +#endif + RefType refType; + refType = fd->isThisDeclarationADefinition() ? + RT_Definition : RT_Declaration; + SymbolType symbolType; + if (llvm::isa(fd)) { - m_client->onFieldUsageParsed( - getParseLocationForTokenAtLocation(init->getMemberLocation()), - getParseFunction(declaration), - getDeclNameHierarchy(init->getMember()) - ); + if (llvm::isa(fd)) + symbolType = ST_Constructor; + else if (llvm::isa(fd)) + symbolType = ST_Destructor; + else + symbolType = ST_Method; + } else + { + symbolType = ST_Function; + } + RecordDeclRef(nd, loc, refType, symbolType); + if (fd->isFunctionTemplateSpecialization()) + { + RecordDeclRef(nd, loc, refType, ST_FunctionTemplateSpecialization); // TODO: functiontemplatespec is more reftype than symboltype } - else if (init->isBaseInitializer()) + //} + } else if (clang::VarDecl *vd = llvm::dyn_cast(d)) { + // Don't record the parameter definitions in a function declaration + // (unless the function declaration is also a definition). A + // definition will be recorded at the function's definition, and + // recording two definitions is unhelpful. This code could record + // a different kind of reference, but recording the position of + // parameter names in declarations doesn't seem useful. + bool omitParamVar = false; + const bool isParam = llvm::isa(vd); + if (isParam) { + clang::FunctionDecl *fd = + llvm::dyn_cast_or_null( + vd->getDeclContext()); + if (fd && !fd->isThisDeclarationADefinition()) + omitParamVar = true; + } + if (!omitParamVar) { + RefType refType; + if (vd->isThisDeclarationADefinition() == clang::VarDecl::DeclarationOnly) + refType = RT_Declaration; + else + refType = RT_Definition; + // TODO: Review for correctness. What about local extern? + SymbolType symbolType; + if (isParam) { - m_client->onTypeUsageParsed( - getParseTypeUsage(init->getTypeSourceInfo()->getTypeLoc(), init->getTypeSourceInfo()->getType()), // TODO: rewrite this to old! - getParseFunction(declaration) - ); + symbolType = ST_Parameter; } - - ASTBodyVisitor bodyVisitor(this, declaration); - bodyVisitor.Visit(init->getInit()); - } - } - } - return true; -} - -bool ASTVisitor::VisitNamespaceDecl(clang::NamespaceDecl* declaration) -{ - if (isLocatedInUnparsedProjectFile(declaration)) - { - m_client->onNamespaceParsed( - declaration->isAnonymousNamespace() ? ParseLocation() : getParseLocationForNamedDecl(declaration), // TODO: why no real parse loc for anonymous namespace? - getDeclNameHierarchy(declaration), - getParseLocation(declaration->getSourceRange()) - ); - } - return true; -} - -bool ASTVisitor::VisitEnumDecl(clang::EnumDecl* declaration) -{ - if (isLocatedInUnparsedProjectFile(declaration)) - { - m_client->onEnumParsed( - getParseLocationForNamedDecl(declaration), - getDeclNameHierarchy(declaration), - convertAccessType(declaration->getAccess()), - getParseLocation(declaration->getSourceRange()) - ); - } - return true; -} - -bool ASTVisitor::VisitEnumConstantDecl(clang::EnumConstantDecl* declaration) -{ - if (isLocatedInUnparsedProjectFile(declaration)) - { - m_client->onEnumConstantParsed( - getParseLocation(declaration->getSourceRange()), - getDeclNameHierarchy(declaration) - ); - } - return true; -} - -bool ASTVisitor::VisitTemplateTypeParmDecl(clang::TemplateTypeParmDecl *declaration) -{ - if (isLocatedInUnparsedProjectFile(declaration) && declaration->hasDefaultArgument()) - { - m_client->onTemplateDefaultArgumentTypeParsed( - getParseTypeUsage(declaration->getDefaultArgumentInfo()->getTypeLoc(), declaration->getDefaultArgument()), - getDeclNameHierarchy(declaration) - ); - } - return true; -} - -bool ASTVisitor::VisitTemplateTemplateParmDecl(clang::TemplateTemplateParmDecl *declaration) -{ - if (isLocatedInUnparsedProjectFile(declaration) && declaration->hasDefaultArgument()) - { - const clang::TemplateArgumentLoc& defaultArgumentLoc = declaration->getDefaultArgument(); - clang::SourceRange sr = defaultArgumentLoc.getSourceRange(); - std::shared_ptr defaultArgumentDataType = std::make_shared( - getDeclNameHierarchy(defaultArgumentLoc.getArgument().getAsTemplate().getAsTemplateDecl()) - ); - m_client->onTemplateDefaultArgumentTypeParsed( - getParseTypeUsage(sr, defaultArgumentDataType), - getDeclNameHierarchy(declaration) - ); - } - return true; -} - -bool ASTVisitor::VisitClassTemplateDecl(clang::ClassTemplateDecl* declaration) -{ - if (isLocatedInUnparsedProjectFile(declaration)) - { - NameHierarchy templateRecordNameHierarchy = getDeclNameHierarchy(declaration); - clang::TemplateParameterList* parameterList = declaration->getTemplateParameters(); - for (size_t i = 0; i < parameterList->size(); i++) - { - clang::NamedDecl* namedDecl = parameterList->getParam(i); - if (!namedDecl->getName().empty()) // do not create node for template param if the param has no name - { - m_client->onTemplateRecordParameterTypeParsed( - getParseLocationForNamedDecl(namedDecl), - getDeclNameHierarchy(namedDecl), - templateRecordNameHierarchy - ); - } - } - } - - // handles explicit specializations and implicit specializations but no explicit partial specializations - for (clang::ClassTemplateDecl::spec_iterator it = declaration->specializations().begin(); - it != declaration->specializations().end(); it++ - ) - { - clang::ClassTemplateSpecializationDecl* specializationDecl = *it; - NameHierarchy specializationNameHierarchy = getDeclNameHierarchy(specializationDecl); - - ParseLocation specializationLocation = getParseLocationForNamedDecl(specializationDecl); - if (specializationDecl->getSpecializationKind() == clang::TSK_ImplicitInstantiation) - { - specializationLocation = getParseLocation(specializationDecl->getPointOfInstantiation()); - } - - // handling template arguments - if (isLocatedInUnparsedProjectFile(specializationDecl) && specializationDecl->isExplicitSpecialization()) - { - processTemplateArgumentsOfExplicitSpecialization(specializationDecl); - } - - if (isLocatedInProjectFile(declaration)) - { - m_client->onTemplateRecordSpecializationParsed( - specializationLocation, - specializationNameHierarchy, - specializationDecl->isStruct() ? ParserClient::RECORD_STRUCT : ParserClient::RECORD_CLASS, - utility::getTemplateSpecializationParentNameHierarchy(specializationDecl) - ); - - // template member specializations - if (specializationDecl->getSpecializationKind() == clang::TSK_ImplicitInstantiation) - { - for (clang::CXXRecordDecl::method_iterator methodIt = specializationDecl->method_begin(); methodIt != specializationDecl->method_end(); methodIt++) + else if (vd->getParentFunctionOrMethod() == NULL) { - clang::CXXMethodDecl* methodDecl = (*methodIt); - if (methodDecl->getTemplatedKind() == clang::FunctionDecl::TK_MemberSpecialization) + if (vd->getAccess() == clang::AS_none) { - m_client->onMethodParsed( - getParseLocation(methodDecl->getMemberSpecializationInfo()->getPointOfInstantiation()), - getParseFunction(methodDecl), - convertAccessType(methodDecl->getAccess()), - getAbstractionType(methodDecl), - ParseLocation() - ); + symbolType = ST_GlobalVariable; + } + else + { + symbolType = ST_Field; + } + } + else + { + symbolType = ST_LocalVariable; + } + RecordDeclRef(nd, loc, refType, symbolType); + } + } else if (clang::TagDecl *td = llvm::dyn_cast(d)) { + RefType refType; + refType = td->isThisDeclarationADefinition() ? RT_Definition : RT_Declaration; + // Mark an extern template declaration as a Declaration rather than + // a Definition. For example: + // template class Foo {}; // Definition of Foo + // extern template class Foo; // Declaration of Foo + if (clang::ClassTemplateSpecializationDecl *spec = + llvm::dyn_cast(td)) { + if (spec->getTemplateSpecializationKind() != + clang::TSK_ExplicitSpecialization) + refType = RT_Declaration; + } - clang::NamedDecl* specializedNamedDecel = methodDecl->getMemberSpecializationInfo()->getInstantiatedFrom(); - if (clang::isa(specializedNamedDecel)) - { - m_client->onTemplateMemberFunctionSpecializationParsed( - getParseLocation(methodDecl->getMemberSpecializationInfo()->getPointOfInstantiation()), - getParseFunction(methodDecl), - getParseFunction(clang::dyn_cast(specializedNamedDecel)) - ); + SymbolType symbolType = ST_Max; + // TODO: Handle the C++11 fixed underlying type of enumeration + // declarations. + switch (td->getTagKind()) + { + case clang::TTK_Struct: symbolType = ST_Struct; break; + case clang::TTK_Union: symbolType = ST_Union; break; + case clang::TTK_Class: symbolType = ST_Class; break; + case clang::TTK_Enum: symbolType = ST_Enum; break; + default: assert(false); + } + RecordDeclRef(nd, loc, refType, symbolType); + + if (clang::isa(td)) + { + RecordDeclRef(nd, loc, refType, ST_ClassTemplateSpecialization); // TODO: classtemplatespec is more reftype than symboltype + } + } else if (clang::UsingDirectiveDecl *ud = llvm::dyn_cast(d)) { + RecordDeclRef( + ud->getNominatedNamespaceAsWritten(), + loc, RT_UsingDirective); + } else if (clang::UsingDecl *usd = llvm::dyn_cast(d)) { + for (auto it = usd->shadow_begin(), itEnd = usd->shadow_end(); + it != itEnd; ++it) { + clang::UsingShadowDecl *shadow = *it; + RecordDeclRef(shadow->getTargetDecl(), loc, RT_Using); + } + } else if (clang::NamespaceAliasDecl *nad = llvm::dyn_cast(d)) { + RecordDeclRef(nad, loc, RT_Declaration, ST_Namespace); +// not needed right now! +// RecordDeclRef(nad, loc, RT_Declaration, ST_Namespace); +// RecordDeclRef(nad->getAliasedNamespace(), +// nad->getTargetNameLoc(), +// RT_NamespaceAlias); + } else if (llvm::isa(d)) { + // TODO: use these cases for creating the connection between two undefined template things + // Do nothing. The function will be recorded when it appears as a + // FunctionDecl. + } else if (llvm::isa(d)) { + // Do nothing. The class will be recorded when it appears as a + // RecordDecl. + } else if (llvm::isa(d)) { + RecordDeclRef(nd, loc, RT_Declaration, ST_Field); + } else if (llvm::isa(d)) { + RecordDeclRef(nd, loc, RT_Declaration, ST_Typedef); + } else if (llvm::isa(d)) { + RecordDeclRef(nd, loc, RT_Declaration, ST_Namespace); + } else if (llvm::isa(d)) { + RecordDeclRef(nd, loc, RT_Declaration, ST_Enumerator); + } else if ( + llvm::isa(d) || + llvm::isa(d) || + llvm::isa(d)) { + RecordDeclRef(nd, loc, RT_Declaration, ST_TemplateParameter); + } else { + RecordDeclRef(nd, loc, RT_Declaration); + } + } + + return true; +} + +//#include "data/parser/ParseFunction.h" +//#include "data/parser/cxx/name_resolver/CxxTypeNameResolver.h" +//#include "data/type/NamedDataType.h" + +bool ASTVisitor::VisitTypeLoc(clang::TypeLoc tl) +{ + clang::TypeLoc::TypeLocClass tlc = tl.getTypeLocClass(); + + if (!tl.getAs().isNull()) + { + const clang::TagTypeLoc &ttl = tl.castAs(); + RecordDeclRef(ttl.getDecl(), + tl.getBeginLoc(), + m_typeContext); + } + else if (!tl.getAs().isNull()) + { + const clang::TypedefTypeLoc &ttl = tl.castAs(); + RecordDeclRef(ttl.getTypedefNameDecl(), + tl.getBeginLoc(), + m_typeContext); + } + else if (!tl.getAs().isNull()) + { + const clang::TemplateTypeParmTypeLoc &ttptl = + tl.castAs(); + RecordDeclRef(ttptl.getDecl(), + tl.getBeginLoc(), + m_typeContext); + } + else if (!tl.getAs().isNull()) + { + const clang::TemplateSpecializationTypeLoc &tstl = + tl.castAs(); + const clang::TemplateSpecializationType &tst = + *tstl.getTypePtr()->getAs(); + if (tst.getAsCXXRecordDecl()) + { + RecordDeclRef(tst.getAsCXXRecordDecl(), + tl.getBeginLoc(), + m_typeContext); + } + else // if template specialization cannot be resolved to a concrete declaration. + { // this is the case when using a specialization of a template template parameter. + RecordTypeRef(tstl.getTypePtr(), + tl.getBeginLoc(), + m_typeContext); + } + } + else if (!tl.getAs().isNull()) + { + const clang::DependentNameTypeLoc& dntl = + tl.castAs(); + RecordTypeRef(dntl.getTypePtr(), + dntl.getNameLoc(), + m_typeContext); + } + else if (!tl.getAs().isNull()) + { + const clang::BuiltinTypeLoc &btl = + tl.castAs(); + RecordTypeRef(btl.getTypePtr(), + tl.getBeginLoc(), + m_typeContext); + } + + return true; +} + + +/////////////////////////////////////////////////////////////////////////////// +// Reference recording + +static inline bool isNamedDeclUnnamed(clang::NamedDecl *d) +{ + return d->getDeclName().isIdentifier() && d->getIdentifier() == NULL; +} + +ParseLocation ASTVisitor::getDeclRefRange(clang::NamedDecl *decl, clang::SourceLocation loc) +{ + ParseLocation parseLocation; + clang::SourceManager& sourceManager = m_context->getSourceManager(); + clang::SourceLocation sloc = sourceManager.getSpellingLoc(loc); + { + clang::FileID fileId = sourceManager.getFileID(sloc); + + if (!fileId.isInvalid()) + { + const clang::FileEntry* fileEntry = sourceManager.getFileEntryForID(fileId); + if (fileEntry != NULL) + { + std::string fielName = fileEntry->getName(); + std::string filePath = FileSystem::absoluteFilePath(fielName); + parseLocation.filePath = FilePath(filePath); + } + } + + unsigned int offset = sourceManager.getFileOffset(sloc); + parseLocation.startLineNumber = sourceManager.getLineNumber(fileId, offset); + parseLocation.startColumnNumber = sourceManager.getColumnNumber(fileId, offset); + } + if (decl) + { + clang::DeclarationName name = decl->getDeclName(); + clang::DeclarationName::NameKind nameKind = name.getNameKind(); + + // A C++ destructor name consists of two tokens, '~' and an identifier. + // Try to include both of them in the ref. + if (nameKind == clang::DeclarationName::CXXDestructorName) { + // Start by getting the destructor name, sans template arguments. + const clang::Type *nameType = name.getCXXNameType().getTypePtr(); + assert(nameType != NULL); + llvm::StringRef className; + if (const clang::InjectedClassNameType *injectedNameType = + nameType->getAs()) { + className = injectedNameType->getDecl()->getName(); + } + else if (const clang::RecordType *recordType = + nameType->getAs()) { + className = recordType->getDecl()->getName(); + } + if (!className.empty()) { // TODO: maybe its better to use tokens here. + // Scan the characters. + const char *const buffer = sourceManager.getCharacterData(sloc); + const char *p = buffer; + if (p != NULL && *p == '~') { + p++; + // Permit whitespace between the ~ and the class name. + // Technically there could be preprocessor tokens, comments, + // etc.. + while (*p == ' ' || *p == '\t') + p++; + // Match the class name against the text in the source. + if (!strncmp(p, className.data(), className.size())) { + p += className.size(); + if (!isalnum(*p) && *p != '_') { + parseLocation.endLineNumber = parseLocation.startLineNumber; + parseLocation.endColumnNumber = parseLocation.startColumnNumber; + parseLocation.endColumnNumber += p - buffer - 1; + return parseLocation; } } } } } - } - return true; -} -bool ASTVisitor::VisitClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl* declaration) -{ - if (isLocatedInUnparsedProjectFile(declaration)) - { - NameHierarchy specializedRecordNameHierarchy = getDeclNameHierarchy(declaration); - NameHierarchy specializationParentNameHierarchy = utility::getTemplateSpecializationParentNameHierarchy(declaration); - - ParserClient::RecordType specializedRecordType = declaration->isStruct() ? ParserClient::RECORD_STRUCT : ParserClient::RECORD_CLASS; - m_client->onTemplateRecordSpecializationParsed( - getParseLocationForNamedDecl(declaration), specializedRecordNameHierarchy, specializedRecordType, specializationParentNameHierarchy - ); - - clang::TemplateParameterList* parameterList = declaration->getTemplateParameters(); - for (size_t i = 0; i < parameterList->size(); i++) - { - clang::NamedDecl* namedDecl = parameterList->getParam(i); - if (!namedDecl->getName().empty()) // do not create node for template param if the param has no name - { - m_client->onTemplateRecordParameterTypeParsed( - getParseLocationForNamedDecl(namedDecl), - getDeclNameHierarchy(namedDecl), - specializedRecordNameHierarchy - ); - } - } - - processTemplateArgumentsOfExplicitSpecialization(declaration); - } - return true; -} - -bool ASTVisitor::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl *declaration) -{ - const ParseFunction templateFunction = getParseFunction(declaration); - if (isLocatedInUnparsedProjectFile(declaration)) - { - clang::TemplateParameterList* parameterList = declaration->getTemplateParameters(); - for (size_t i = 0; i < parameterList->size(); i++) - { - clang::NamedDecl* namedDecl = parameterList->getParam(i); - if (!namedDecl->getName().empty()) // do not create node for template param if the param has no name - { - m_client->onTemplateFunctionParameterTypeParsed( - getParseLocationForNamedDecl(namedDecl), - getDeclNameHierarchy(namedDecl), - templateFunction - ); + // For references to C++ overloaded operators, try to include both the + // operator keyword and the operator name in the ref. + if (nameKind == clang::DeclarationName::CXXOperatorName) { + const char *spelling = clang::getOperatorSpelling( + name.getCXXOverloadedOperator()); + if (spelling != NULL) { + const char *const buffer = sourceManager.getCharacterData(sloc); + const char *p = buffer; + if (p != NULL && !strncmp(p, "operator", 8)) { + p += 8; + // Skip whitespace between "operator" and the operator itself. + while (*p == ' ' || *p == '\t') + p++; + // Look for the operator name. This may be too restrictive for + // recognizing multi-token operators like operator[], operator + // delete[], or operator ->*. + if (!strncmp(p, spelling, strlen(spelling))) { + p += strlen(spelling); + parseLocation.endLineNumber = parseLocation.startLineNumber; + parseLocation.endColumnNumber = parseLocation.startColumnNumber; + parseLocation.endColumnNumber += p - buffer - 1; + return parseLocation; + } + } } } } - - for (clang::FunctionTemplateDecl::spec_iterator it = declaration->specializations().begin(); it != declaration->specializations().end(); it++) + // General case -- find the end of the token starting at loc. + { - clang::FunctionDecl* specializationDecl = *it; - bool needsToProcessSpecialization = false; - - if (specializationDecl->getTemplateSpecializationKind() == clang::TSK_ExplicitSpecialization) - { - if (isLocatedInUnparsedProjectFile(declaration)) - { - processTemplateArgumentsOfExplicitSpecialization(specializationDecl); - needsToProcessSpecialization = true; - } - } - else if (isLocatedInProjectFile(declaration)) - { - needsToProcessSpecialization = true; - } - - if (needsToProcessSpecialization) - { - processFunctionDecl(specializationDecl); - - m_client->onTemplateFunctionSpecializationParsed( - getParseLocationForNamedDecl(specializationDecl), - getParseFunction(specializationDecl), - templateFunction - ); - } + clang::SourceLocation endSloc = + m_preprocessor->getLocForEndOfToken(sloc); + unsigned int offset = sourceManager.getFileOffset(endSloc); + clang::FileID fileId = sourceManager.getFileID(endSloc); + parseLocation.endLineNumber = sourceManager.getLineNumber(fileId, offset); + parseLocation.endColumnNumber = sourceManager.getColumnNumber(fileId, offset) - 1; } - return true; + return parseLocation; } -void ASTVisitor::VisitCallExprInDeclBody(clang::FunctionDecl* decl, clang::CallExpr* expr) +void ASTVisitor::RecordTypeRef( + const clang::Type* type, + clang::SourceLocation beginLoc, + RefType refType, + SymbolType symbolType) { - clang::FunctionDecl* calleeFunctionDecl = expr->getDirectCallee(); - if (!calleeFunctionDecl) + if (isLocatedInProjectFile(beginLoc)) + { + ParseLocation parseLocation = getDeclRefRange(0, beginLoc); + NameHierarchy typeNameHierarchy = m_typeNameCache->getName(type); + NameHierarchy contextNameHierarchy = m_contextNameGenerator->getName(); + + if (refType == RT_TemplateArgument) + { + m_client->onTemplateArgumentTypeParsed( + parseLocation, typeNameHierarchy, contextNameHierarchy); + } + else if (refType == RT_BaseClass) + { + m_client->onInheritanceParsed( + parseLocation, contextNameHierarchy, typeNameHierarchy, m_contextAccess); + } + else if (refType == RT_TemplateDefaultArgument) + { + m_client->onTemplateDefaultArgumentTypeParsed( // TODO: rename second parameter to "parameter" + parseLocation, typeNameHierarchy, contextNameHierarchy); + } + else + { + m_client->onTypeUsageParsed( + parseLocation, contextNameHierarchy, typeNameHierarchy); + } + } +} + +void ASTVisitor::RecordDeclRef( + clang::NamedDecl *d, + clang::SourceLocation beginLoc, + RefType refType, + SymbolType symbolType) +{ + if ((!d) || + (d->isImplicit() && !isLocatedInProjectFile(beginLoc)) || + (!d->isImplicit() && !isLocatedInUnparsedProjectFile(beginLoc))) { - // TODO: Save error at location. return; } - m_client->onCallParsed( - getParseLocation(expr->getSourceRange()), - getParseFunction(decl), - getParseFunction(calleeFunctionDecl) - ); -} + ParseLocation parseLocation = getDeclRefRange(d, beginLoc); + NameHierarchy declNameHierarchy = m_declNameCache->getName(d); + + bool fallback = false; -void ASTVisitor::VisitCallExprInDeclBody(clang::DeclaratorDecl* decl, clang::CallExpr* expr) -{ - if (!expr->getDirectCallee()) - { - // TODO: Save error at location. - return; - } - - m_client->onCallParsed( - getParseLocation(expr->getSourceRange()), - getParseVariable(decl), - getParseFunction(expr->getDirectCallee()) - ); -} - -void ASTVisitor::VisitDeclRefExprInDeclBody(clang::FunctionDecl* decl, clang::DeclRefExpr* expr) -{ - processTemplateArguments(expr); -} - -void ASTVisitor::VisitDeclRefExprInDeclBody(clang::DeclaratorDecl* decl, clang::DeclRefExpr* expr) -{ - processTemplateArguments(expr); -} - -void ASTVisitor::VisitCXXConstructExprInDeclBody(clang::FunctionDecl* decl, clang::CXXConstructExpr* expr) -{ - m_client->onCallParsed( - getParseLocationForTokensInRange(expr->getSourceRange()), - getParseFunction(decl), - getParseFunction(expr->getConstructor()) - ); -} - -void ASTVisitor::VisitCXXConstructExprInDeclBody(clang::DeclaratorDecl* decl, clang::CXXConstructExpr* expr) -{ - m_client->onCallParsed( - getParseLocationForTokensInRange(expr->getSourceRange()), - getParseVariable(decl), - getParseFunction(expr->getConstructor()) - ); -} - -void ASTVisitor::VisitExplicitCastExprInDeclBody(clang::FunctionDecl* decl, clang::ExplicitCastExpr* expr) -{ - processTemplateArguments(expr->getTypeInfoAsWritten()->getTypeLoc()); -} - -void ASTVisitor::VisitExplicitCastExprInDeclBody(clang::DeclaratorDecl* decl, clang::ExplicitCastExpr* expr) -{ - processTemplateArguments(expr->getTypeInfoAsWritten()->getTypeLoc()); -} - -void ASTVisitor::VisitCXXTemporaryObjectExprInDeclBody(clang::FunctionDecl* decl, clang::CXXTemporaryObjectExpr* expr) -{ - processTemplateArguments(expr->getTypeSourceInfo()->getTypeLoc()); -} - -void ASTVisitor::VisitCXXTemporaryObjectExprInDeclBody(clang::DeclaratorDecl* decl, clang::CXXTemporaryObjectExpr* expr) -{ - processTemplateArguments(expr->getTypeSourceInfo()->getTypeLoc()); -} - -void ASTVisitor::VisitCXXNewExprInDeclBody(clang::FunctionDecl* decl, clang::CXXNewExpr* expr) -{ - m_client->onTypeUsageParsed( - getParseTypeUsage(expr->getAllocatedTypeSourceInfo()->getTypeLoc(), expr->getAllocatedType()), - getParseFunction(decl) - ); - - processTemplateArguments(expr->getAllocatedTypeSourceInfo()->getTypeLoc()); -} - -void ASTVisitor::VisitCXXNewExprInDeclBody(clang::DeclaratorDecl* decl, clang::CXXNewExpr* expr) -{ - m_client->onTypeUsageParsed( - getParseTypeUsage(expr->getAllocatedTypeSourceInfo()->getTypeLoc(), expr->getAllocatedType()), - getParseVariable(decl) - ); - - processTemplateArguments(expr->getAllocatedTypeSourceInfo()->getTypeLoc()); -} - -void ASTVisitor::VisitMemberExprInDeclBody(clang::FunctionDecl* decl, clang::MemberExpr* expr) -{ - ParseLocation parseLocation = getParseLocation(expr->getSourceRange()); - - const std::string exprName = expr->getMemberNameInfo().getAsString(); - parseLocation.endColumnNumber += exprName.size() - 1; - - m_client->onFieldUsageParsed( - parseLocation, - getParseFunction(decl), - getDeclNameHierarchy(expr->getMemberDecl()) - ); -} - -void ASTVisitor::VisitMemberExprInDeclBody(clang::DeclaratorDecl* decl, clang::MemberExpr* expr) -{ - ParseLocation parseLocation = getParseLocation(expr->getSourceRange()); - - const std::string exprName = expr->getMemberNameInfo().getAsString(); - parseLocation.endColumnNumber += exprName.size() - 1; - - m_client->onFieldUsageParsed( - parseLocation, - getParseVariable(decl), - getDeclNameHierarchy(expr->getMemberDecl()) - ); -} - -void ASTVisitor::VisitGlobalVariableExprInDeclBody(clang::FunctionDecl* decl, clang::DeclRefExpr* expr) -{ - ParseLocation parseLocation = getParseLocation(expr->getSourceRange()); - - const std::string exprName = expr->getNameInfo().getAsString(); - parseLocation.endColumnNumber += exprName.size() - 1; - - m_client->onGlobalVariableUsageParsed( - parseLocation, - getParseFunction(decl), - getDeclNameHierarchy(expr->getDecl()) - ); -} - -void ASTVisitor::VisitGlobalVariableExprInDeclBody(clang::DeclaratorDecl* decl, clang::DeclRefExpr* expr) -{ - ParseLocation parseLocation = getParseLocation(expr->getSourceRange()); - - const std::string exprName = expr->getNameInfo().getAsString(); - parseLocation.endColumnNumber += exprName.size() - 1; - - m_client->onGlobalVariableUsageParsed( - parseLocation, - getParseVariable(decl), - getDeclNameHierarchy(expr->getDecl()) - ); -} - -void ASTVisitor::VisitEnumExprInDeclBody(clang::FunctionDecl* decl, clang::DeclRefExpr* expr) -{ - ParseLocation parseLocation = getParseLocation(expr->getSourceRange()); - - const std::string exprName = expr->getNameInfo().getAsString(); - parseLocation.endColumnNumber += exprName.size() - 1; - - m_client->onEnumConstantUsageParsed( - parseLocation, - getParseFunction(decl), - getDeclNameHierarchy(expr->getDecl()) - ); -} - -void ASTVisitor::VisitEnumExprInDeclBody(clang::DeclaratorDecl* decl, clang::DeclRefExpr* expr) -{ - ParseLocation parseLocation = getParseLocation(expr->getSourceRange()); - - const std::string exprName = expr->getNameInfo().getAsString(); - parseLocation.endColumnNumber += exprName.size() - 1; - - m_client->onEnumConstantUsageParsed( - parseLocation, - getParseVariable(decl), - getDeclNameHierarchy(expr->getDecl()) - ); -} - -void ASTVisitor::VisitVarDeclInDeclBody(clang::FunctionDecl* decl, clang::VarDecl* varDecl) -{ - m_client->onTypeUsageParsed( - getParseTypeUsage(varDecl->getTypeSourceInfo()->getTypeLoc(), varDecl->getType()), - getParseFunction(decl) - ); - - processTemplateArguments(varDecl->getTypeSourceInfo()->getTypeLoc()); -} - -void ASTVisitor::processFunctionDecl(clang::FunctionDecl* declaration) -{ - m_client->onFunctionParsed( - getParseLocationForNamedDecl(declaration), - getParseFunction(declaration), - getParseLocationOfFunctionBody(declaration) - ); - - // handle template arguments of return type. - clang::TypeLoc functionLoc = declaration->getTypeSourceInfo()->getTypeLoc(); - if (functionLoc.getTypeLocClass() == clang::TypeLoc::TypeLocClass::FunctionProto) - { - processTemplateArguments(functionLoc.getAs().getReturnLoc()); - } - - - if (declaration->hasBody() && - declaration->isThisDeclarationADefinition() && - !declaration->isDependentContext() + if ( + refType == RT_Declaration || + refType == RT_Definition ) { - ASTBodyVisitor bodyVisitor(this, declaration); - bodyVisitor.Visit(declaration->getBody()); - } -} - -void ASTVisitor::processTemplateArgumentsOfExplicitSpecialization(clang::FunctionDecl* specializationDecl) -{ - ParseFunction specializationFunction = getParseFunction(specializationDecl); - - if (specializationDecl->getTemplateSpecializationArgsAsWritten()) - { - const clang::ASTTemplateArgumentListInfo* argumentInfoList = specializationDecl->getTemplateSpecializationArgsAsWritten(); - for (size_t i = 0; i < argumentInfoList->NumTemplateArgs; i++) + switch (symbolType) { - const clang::TemplateArgumentLoc& argumentLoc = argumentInfoList->operator[](i); - - const clang::TemplateArgument& argument = argumentLoc.getArgument(); - NameHierarchy argumentNameHierarchy = utility::templateArgumentToDataType(argument)->getTypeNameHierarchy(); - if (argumentNameHierarchy.size()) // FIXME: Some TemplateArgument kinds are not handled yet. + case ST_Typedef: + if (clang::TypedefDecl* typedefDecl = clang::dyn_cast(d)) { - m_client->onTemplateArgumentTypeOfTemplateFunctionParsed( - getParseLocation(argumentLoc.getSourceRange()), - argumentNameHierarchy, - specializationFunction - ); + m_client->onTypedefParsed( + parseLocation, + declNameHierarchy, + convertAccessType(typedefDecl->getAccess())); } + break; + case ST_Class: + if (clang::RecordDecl* recordDecl = clang::dyn_cast(d)) + { + m_client->onClassParsed( + parseLocation, + declNameHierarchy, + convertAccessType(recordDecl->getAccess()), + (refType == RT_Definition ? getParseLocationOfRecordBody(recordDecl) : ParseLocation())); + } + break; + case ST_Struct: + if (clang::RecordDecl* recordDecl = clang::dyn_cast(d)) + { + m_client->onStructParsed( + parseLocation, + declNameHierarchy, + convertAccessType(recordDecl->getAccess()), + (refType == RT_Definition ? getParseLocationOfRecordBody(recordDecl) : ParseLocation())); + } + break; + case ST_GlobalVariable: + m_client->onGlobalVariableParsed( + parseLocation, + declNameHierarchy); + break; + case ST_Field: + //if (clang::VarDecl* varDecl = clang::dyn_cast(d)) + { + m_client->onFieldParsed( + parseLocation, + declNameHierarchy, + convertAccessType(d->getAccess())); } - } -} - -void ASTVisitor::processTemplateArgumentsOfExplicitSpecialization(clang::ClassTemplateSpecializationDecl* specializationDecl) -{ - NameHierarchy specializedRecordNameHierarchy = getDeclNameHierarchy(specializationDecl); - if (clang::ClassTemplatePartialSpecializationDecl* partialSpecializationDecl = - clang::dyn_cast_or_null(specializationDecl)) - { - const clang::ASTTemplateArgumentListInfo* argumentInfoList = partialSpecializationDecl->getTemplateArgsAsWritten(); - for (size_t i = 0; i < argumentInfoList->NumTemplateArgs; i++) - { - const clang::TemplateArgumentLoc& argumentLoc = argumentInfoList->operator[](i); - const clang::TemplateArgument& argument = argumentLoc.getArgument(); - - NameHierarchy argumentNameHierarchy = utility::templateArgumentToDataType(argument)->getTypeNameHierarchy(); - if (argumentNameHierarchy.size()) // FIXME: Some TemplateArgument kinds are not handled yet. + break; + case ST_Function: + if (clang::FunctionDecl* functionDecl = clang::dyn_cast(d)) { - m_client->onTemplateArgumentTypeOfTemplateRecordParsed( - getParseLocationForTokensInRange(argumentLoc.getSourceRange()), - argumentNameHierarchy, - specializedRecordNameHierarchy - ); + m_client->onFunctionParsed( + parseLocation, + declNameHierarchy, + (refType == RT_Definition ? getParseLocationOfFunctionBody(functionDecl) : ParseLocation())); } + break; + case ST_Constructor: + case ST_Destructor: + case ST_Method: + if (clang::CXXMethodDecl* methodDecl = clang::dyn_cast(d)) + { + m_client->onMethodParsed( + parseLocation, + declNameHierarchy, + convertAccessType(methodDecl->getAccess()), + getAbstractionType(methodDecl), + (refType == RT_Definition ? getParseLocationOfFunctionBody(methodDecl) : ParseLocation())); + + for (clang::CXXMethodDecl::method_iterator it = methodDecl->begin_overridden_methods(); // iterate in traversal and use RT_Overridden or so.. + it != methodDecl->end_overridden_methods(); it++) + { + m_client->onMethodOverrideParsed( + parseLocation, + m_declNameCache->getName(*it), + declNameHierarchy); + } + + clang::MemberSpecializationInfo* memberSpecializationInfo = methodDecl->getMemberSpecializationInfo(); + if (memberSpecializationInfo) + { + clang::NamedDecl* specializedNamedDecl = memberSpecializationInfo->getInstantiatedFrom(); + if (clang::isa(specializedNamedDecl)) + { + m_client->onTemplateMemberFunctionSpecializationParsed( + parseLocation, + declNameHierarchy, + m_declNameCache->getName(specializedNamedDecl)); + } + } + } + break; + case ST_Namespace: + if (clang::NamespaceDecl* namespaceDecl = clang::dyn_cast(d)) + { + m_client->onNamespaceParsed( + namespaceDecl->isAnonymousNamespace() ? ParseLocation() : parseLocation, + declNameHierarchy, + getParseLocation(namespaceDecl->getSourceRange())); + } + else if (clang::NamespaceAliasDecl* namespaceAliasDecl = clang::dyn_cast(d)) + { + m_client->onNamespaceParsed( + parseLocation, + declNameHierarchy, + getParseLocation(namespaceAliasDecl->getAliasedNamespace()->getSourceRange())); + } + break; + case ST_Enum: + if (clang::EnumDecl* enumDecl = clang::dyn_cast(d)) + { + m_client->onEnumParsed( + parseLocation, + declNameHierarchy, + convertAccessType(enumDecl->getAccess()), + getParseLocation(enumDecl->getSourceRange())); + } + break; + case ST_Enumerator: + m_client->onEnumConstantParsed( + parseLocation, + declNameHierarchy); + break; + case ST_TemplateParameter: + if (!d->getName().empty()) // We don't create symbols for unnamed template parameters. + { + m_client->onTemplateParameterTypeParsed( + parseLocation, + declNameHierarchy); + } + break; + case ST_ClassTemplateSpecialization: + if (clang::ClassTemplateSpecializationDecl* classTemplateSpecializationDecl = clang::dyn_cast(d)) // TODO: we need a different reftype here! and st_max? mabe rewrite TraverseClassTemplateSpecializationDecl() + { + clang::NamedDecl* specializedFromDecl; + llvm::PointerUnion pu = classTemplateSpecializationDecl->getSpecializedTemplateOrPartial(); + if (pu.is()) + { + specializedFromDecl = pu.get(); + } + else if (pu.is()) + { + specializedFromDecl = pu.get(); + } + + m_client->onTemplateSpecializationParsed( + parseLocation, + declNameHierarchy, + m_declNameCache->getName(specializedFromDecl)); // use context and childcontext!! + } + break; + case ST_FunctionTemplateSpecialization: + if (clang::FunctionDecl* functionDecl = clang::dyn_cast(d)) + { + m_client->onTemplateSpecializationParsed( + parseLocation, + declNameHierarchy, + m_declNameCache->getName(functionDecl->getPrimaryTemplate()->getTemplatedDecl())); // TODO: use contect and childcontext!! + } + break; + case ST_LocalVariable: + case ST_Parameter: + // Do nothing. + break; + default: + fallback = true; + break; } } else { - if (clang::TypeSourceInfo* typeSourceInfo = specializationDecl->getTypeAsWritten()) + const NameHierarchy contextNameHierarchy = m_contextNameGenerator->getName(); + switch (symbolType) { - processTemplateArguments(typeSourceInfo->getTypeLoc()); + case ST_Field: + m_client->onFieldUsageParsed( + parseLocation, + contextNameHierarchy, + declNameHierarchy + ); + break; + case ST_GlobalVariable: + if (refType == RT_TemplateArgument) + { + m_client->onTemplateArgumentTypeParsed( + parseLocation, declNameHierarchy, contextNameHierarchy); + } + else + { + m_client->onGlobalVariableUsageParsed( + parseLocation, + contextNameHierarchy, + declNameHierarchy); + } + break; + case ST_Enumerator: + m_client->onEnumConstantUsageParsed( + parseLocation, + contextNameHierarchy, + declNameHierarchy); + break; + case ST_Max: + switch (refType) + { + case RT_Called: + m_client->onCallParsed( + parseLocation, contextNameHierarchy, declNameHierarchy); + break; + case RT_Reference: + m_client->onTypeUsageParsed( + parseLocation, contextNameHierarchy, declNameHierarchy); + break; + case RT_TemplateArgument: + m_client->onTemplateArgumentTypeParsed( + parseLocation, declNameHierarchy, contextNameHierarchy); + break; + case RT_TemplateDefaultArgument: + m_client->onTemplateDefaultArgumentTypeParsed( + parseLocation, declNameHierarchy, contextNameHierarchy); + break; + case RT_BaseClass: + m_client->onInheritanceParsed( + parseLocation, contextNameHierarchy, declNameHierarchy, m_contextAccess); + break; + case RT_Assigned: + case RT_AddressTaken: + case RT_Read: + case RT_Qualifier: + // Do nothing. + break; + default: + fallback = true; + break; + } + break; + case ST_LocalVariable: + case ST_Parameter: + // Do nothing. + break; + default: + fallback = true; + break; + } + } + + if (fallback) + { + std::string name = declNameHierarchy.back()->getName(); + declNameHierarchy.pop(); + declNameHierarchy.push(std::make_shared(name, NameElement::Signature("", "[" + std::to_string(symbolType) + "|" + std::to_string(refType) + "]"))); + + m_client->onFunctionParsed( + parseLocation, + declNameHierarchy, + parseLocation + ); + } + + + + + + //beginLoc = m_indexerContext.sourceManager().getSpellingLoc(beginLoc); + //clang::FileID fileID; + //if (beginLoc.isValid()) + // fileID = m_indexerContext.sourceManager().getFileID(beginLoc); + //IndexerFileContext &fileContext = m_indexerContext.fileContext(fileID); + //indexdb::ID symbolID = fileContext.getDeclSymbolID(d); + + //// Pass the prepared data to the IndexBuilder to record. + //fileContext.builder().recordRef( + // symbolID, + // range.first, + // range.second, + // fileContext.getRefTypeID(refType)); + //if (symbolType != ST_Max) { + // fileContext.builder().recordSymbol( + // symbolID, + // fileContext.getSymbolTypeID(symbolType)); + // if (symbolType != ST_LocalVariable && symbolType != ST_Parameter) { + // fileContext.builder().recordGlobalSymbol(symbolID); + // } + //} +} +bool ASTVisitor::isLocatedInUnparsedProjectFile(clang::SourceLocation loc) +{ + clang::SourceManager& sourceManager = m_context->getSourceManager(); + clang::SourceLocation spellingLoc = sourceManager.getSpellingLoc(loc); + + clang::FileID fileId; + + if (spellingLoc.isValid()) + { + fileId = sourceManager.getFileID(spellingLoc); + } + if (!fileId.isInvalid()) + { + auto it = m_inUnparsedProjectFileMap.find(fileId); + if (it != m_inUnparsedProjectFileMap.end()) + { + return it->second; + } + + bool ret = false; + if (m_context->getSourceManager().isWrittenInMainFile(spellingLoc)) + { + ret = true; } else { - LOG_WARNING("Could not locate template arguments of explicit template specialization: " + specializedRecordNameHierarchy.getFullName()); - } - } -} - -void ASTVisitor::processTemplateArguments(clang::DeclRefExpr* expr) -{ - if (!isLocatedInProjectFile(getParseLocation(expr->getSourceRange()))) - { - return; - } - clang::FunctionDecl* specializationDecl = clang::dyn_cast_or_null(expr->getDecl()); - if (!specializationDecl) - { - return; - } - clang::FunctionTemplateDecl* specializedDecl = specializationDecl->getPrimaryTemplate(); // just to check if it is really a template.. can be done differently - if (!specializedDecl) - { - return; - } - - ParseFunction specializationFunction = getParseFunction(specializationDecl); - - if (expr->hasExplicitTemplateArgs()) // handle explicit template args - { - const clang::TemplateArgumentLoc* arguments = expr->getTemplateArgs(); - - for (unsigned int i = 0; i < expr->getNumTemplateArgs(); i++) - { - clang::TemplateArgument argument = arguments[i].getArgument(); - NameHierarchy argumentNameHierarchy = utility::templateArgumentToDataType(argument)->getTypeNameHierarchy(); - if (argumentNameHierarchy.size()) // FIXME: Some TemplateArgument kinds are not handled yet. + const clang::FileEntry* fileEntry = sourceManager.getFileEntryForID(fileId); + if (fileEntry != NULL) { - m_client->onTemplateArgumentTypeOfTemplateFunctionParsed( - getParseLocation(arguments[i].getSourceRange()), - argumentNameHierarchy, - specializationFunction - ); + std::string fielName = fileEntry->getName(); + std::string filePath = FileSystem::absoluteFilePath(fielName); + ret = m_fileRegister->includeFileIsParsing(filePath); } } - } - else // handle implicit template args - { - const clang::TemplateArgumentList* argumentList = specializationDecl->getTemplateSpecializationArgs(); - for (size_t i = 0; i < argumentList->size(); ++i) - { - const clang::TemplateArgument& argument = argumentList->get(i); - NameHierarchy argumentNameHierarchy = utility::templateArgumentToDataType(argument)->getTypeNameHierarchy(); - if (argumentNameHierarchy.size()) // FIXME: Some TemplateArgument kinds are not handled yet. - { - const clang::SourceLocation argumentSourceLoc = clang::Lexer::getLocForEndOfToken( - expr->getLocEnd(), 1, m_context->getSourceManager(), clang::LangOptions() - ); - m_client->onTemplateArgumentTypeOfTemplateFunctionParsed( - getParseLocation(clang::SourceRange(argumentSourceLoc, argumentSourceLoc)), - argumentNameHierarchy, - specializationFunction - ); - } - } - } -} - -void ASTVisitor::processTemplateArguments(clang::TypeLoc typeLoc) -{ - clang::TemplateSpecializationTypeLoc specializationLoc = utility::getNextTypeLoc(typeLoc); - if (!specializationLoc.isNull()) - { - NameHierarchy specializationNameHierarchy = utility::qualTypeToDataType(specializationLoc.getType())->getTypeNameHierarchy(); - - if (!isLocatedInProjectFile(getParseLocation(specializationLoc.getSourceRange()))) - { - return; - } - - for (unsigned int i = 0; i < specializationLoc.getNumArgs(); i++) - { - const clang::TemplateArgument& argument = specializationLoc.getArgLoc(i).getArgument(); - NameHierarchy argumentNameHierarchy = utility::templateArgumentToDataType(argument)->getTypeNameHierarchy(); - if (argumentNameHierarchy.size()) // FIXME: Some TemplateArgument kinds are not handled yet. - { - m_client->onTemplateArgumentTypeOfTemplateRecordParsed( - getParseLocationForTokensInRange(specializationLoc.getArgLoc(i).getSourceRange()), - argumentNameHierarchy, - specializationNameHierarchy - ); - } - } - } -} - -bool ASTVisitor::isLocatedInUnparsedProjectFile(const clang::Decl* declaration) const -{ - const clang::SourceLocation& location = declaration->getLocStart(); - - if (!location.isValid()) - { - return false; - } - - if (m_context->getSourceManager().isWrittenInMainFile(location)) - { - return true; - } - - return m_fileRegister->includeFileIsParsing(FilePath(m_context->getSourceManager().getFilename(location))); -} - -bool ASTVisitor::isLocatedInProjectFile(const ParseLocation& location) const -{ - if (location.isValid()) - { - return m_fileRegister->getFileManager()->hasFilePath(location.filePath); + m_inUnparsedProjectFileMap[fileId] = ret; + return ret; } return false; } -bool ASTVisitor::isLocatedInProjectFile(const clang::Decl* declaration) const +bool ASTVisitor::isLocatedInProjectFile(clang::SourceLocation loc) { - const clang::SourceLocation& location = declaration->getLocStart(); - if (location.isValid()) + clang::SourceManager& sourceManager = m_context->getSourceManager(); + clang::SourceLocation spellingLoc = sourceManager.getSpellingLoc(loc); + + clang::FileID fileId; + + if (spellingLoc.isValid()) { - const clang::SourceManager& sourceManager = m_context->getSourceManager(); - std::string filePath = FileSystem::absoluteFilePath(sourceManager.getFilename(location)); - return m_fileRegister->getFileManager()->hasFilePath(filePath); + fileId = sourceManager.getFileID(spellingLoc); + } + if (!fileId.isInvalid()) + { + + auto it = m_inProjectFileMap.find(fileId); + if (it != m_inProjectFileMap.end()) + { + return it->second; + } + + const clang::FileEntry* fileEntry = sourceManager.getFileEntryForID(fileId); + if (fileEntry != NULL) + { + std::string fielName = fileEntry->getName(); + std::string filePath = FileSystem::absoluteFilePath(fielName); + bool ret = m_fileRegister->getFileManager()->hasFilePath(filePath); + m_inProjectFileMap[fileId] = ret; + return ret; + } } return false; } @@ -921,92 +1482,6 @@ ParserClient::AbstractionType ASTVisitor::getAbstractionType(const clang::CXXMet return abstraction; } -ParseLocation ASTVisitor::getParseLocation(const clang::SourceRange& sourceRange) const -{ - if (sourceRange.isInvalid()) - { - return ParseLocation(); - } - - const clang::SourceManager& sourceManager = m_context->getSourceManager(); - const clang::PresumedLoc& presumedBegin = sourceManager.getPresumedLoc(sourceRange.getBegin(), false); - const clang::PresumedLoc& presumedEnd = sourceManager.getPresumedLoc(sourceRange.getEnd(), false); - - return ParseLocation( - presumedBegin.getFilename(), - presumedBegin.getLine(), - presumedBegin.getColumn(), - presumedEnd.getLine(), - presumedEnd.getColumn() - ); -} - -ParseLocation ASTVisitor::getParseLocationForTokenAtLocation(const clang::SourceLocation& loc) const -{ - return getParseLocationForTokensInRange(clang::SourceRange(loc, loc)); -} - -ParseLocation ASTVisitor::getParseLocationForTokensInRange(const clang::SourceRange& range) const -{ - if (range.isInvalid()) - { - return ParseLocation(); - } - - const clang::SourceManager& sourceManager = m_context->getSourceManager(); - - clang::SourceLocation startLoc = clang::Lexer::GetBeginningOfToken(range.getBegin(), sourceManager, clang::LangOptions()); - clang::SourceLocation endLoc = clang::Lexer::getLocForEndOfToken(range.getEnd(), 1, sourceManager, clang::LangOptions()); - - const clang::PresumedLoc& presumedBegin = sourceManager.getPresumedLoc(startLoc); - if (endLoc.isValid()) - { - const clang::PresumedLoc& presumedEnd = sourceManager.getPresumedLoc(endLoc); - return ParseLocation( - presumedBegin.getFilename(), - presumedBegin.getLine(), - presumedBegin.getColumn(), - presumedEnd.getLine(), - presumedEnd.getColumn() - ); - } - - uint tokenLength = clang::Lexer::MeasureTokenLength(range.getEnd(), sourceManager, clang::LangOptions()); - return ParseLocation( - presumedBegin.getFilename(), - presumedBegin.getLine(), - presumedBegin.getColumn(), - presumedBegin.getLine(), - presumedBegin.getColumn() + tokenLength - 1 - ); -} - -ParseLocation ASTVisitor::getParseLocationForNamedDecl(const clang::NamedDecl* decl) const -{ - return getParseLocationForTokenAtLocation(decl->getLocation()); -} - -ParseLocation ASTVisitor::getParseLocationOfFunctionBody(const clang::FunctionDecl* decl) const -{ - if (decl->hasBody() && decl->isThisDeclarationADefinition()) - { - clang::SourceRange range; - clang::FunctionTemplateDecl* templateDecl = decl->getDescribedFunctionTemplate(); - if (templateDecl) - { - range = templateDecl->getSourceRange(); - } - else - { - range = decl->getSourceRange(); - } - - return getParseLocation(range); - } - - return ParseLocation(); -} - ParseLocation ASTVisitor::getParseLocationOfRecordBody(clang::RecordDecl* decl) const { @@ -1032,144 +1507,44 @@ ParseLocation ASTVisitor::getParseLocationOfRecordBody(clang::RecordDecl* decl) return ParseLocation(); } -ParseTypeUsage ASTVisitor::getParseTypeUsage(const clang::TypeLoc& typeLoc, const clang::QualType& type) const +ParseLocation ASTVisitor::getParseLocationOfFunctionBody(const clang::FunctionDecl* decl) const { - std::shared_ptr dataType = utility::qualTypeToDataType(type); - return getParseTypeUsage(typeLoc, dataType); -} - -ParseTypeUsage ASTVisitor::getParseTypeUsage(const clang::TypeLoc& typeLoc, const std::shared_ptr type) const -{ - ParseLocation parseLocation; - - if (!typeLoc.isNull()) + if (decl->hasBody() && decl->isThisDeclarationADefinition()) { - clang::SourceRange sr( - typeLoc.getLocStart(), - clang::Lexer::getLocForEndOfToken(typeLoc.getLocEnd(), 0, m_context->getSourceManager(), clang::LangOptions()) - ); - - parseLocation = getParseLocation(sr); - parseLocation.endColumnNumber -= 1; - } - - return ParseTypeUsage(parseLocation, type); -} - -ParseTypeUsage ASTVisitor::getParseTypeUsage(const clang::SourceRange& sourceRange, const std::shared_ptr type) const -{ - ParseLocation parseLocation; - - if (sourceRange.isValid()) - { - clang::SourceRange sr( - sourceRange.getBegin(), - clang::Lexer::getLocForEndOfToken(sourceRange.getEnd(), 0, m_context->getSourceManager(), clang::LangOptions()) - ); - - parseLocation = getParseLocation(sr); - parseLocation.endColumnNumber -= 1; - } - - return ParseTypeUsage(parseLocation, type); -} - -ParseTypeUsage ASTVisitor::getParseTypeUsageOfReturnType(const clang::FunctionDecl* declaration) const -{ - clang::TypeLoc typeLoc; - - const clang::TypeSourceInfo *TSI = declaration->getTypeSourceInfo(); - if (TSI) - { - const clang::FunctionTypeLoc FTL = TSI->getTypeLoc().IgnoreParens().getAs(); - if (FTL) + clang::SourceRange range; + clang::FunctionTemplateDecl* templateDecl = decl->getDescribedFunctionTemplate(); + if (templateDecl) { - typeLoc = FTL.getReturnLoc(); + range = templateDecl->getSourceRange(); } - } - - return getParseTypeUsage(typeLoc, declaration->getReturnType()); -} - -std::vector ASTVisitor::getParameters(const clang::FunctionDecl* declaration) const -{ - std::vector parameters; - - for (unsigned i = 0; i < declaration->getNumParams(); i++) - { - const clang::ParmVarDecl* paramDecl = declaration->getParamDecl(i); - if (paramDecl->getTypeSourceInfo()) + else { - parameters.push_back(getParseTypeUsage(paramDecl->getTypeSourceInfo()->getTypeLoc(), paramDecl->getType())); + range = decl->getSourceRange(); } + + return getParseLocation(range); } - return parameters; + return ParseLocation(); } -ParseVariable ASTVisitor::getParseVariable(const clang::DeclaratorDecl* declaration) +ParseLocation ASTVisitor::getParseLocation(const clang::SourceRange& sourceRange) const { - bool isStatic = false; - NameHierarchy hameHierarchy = getDeclNameHierarchy(declaration); - if (clang::isa(declaration)) + if (sourceRange.isInvalid()) { - const clang::VarDecl* varDecl = clang::dyn_cast(declaration); - isStatic = varDecl->isStaticDataMember() || varDecl->getStorageClass() == clang::SC_Static; - } - else if (clang::isa(declaration)) - { - isStatic = false; // fieldDecls cannot be static. If they are, they are treated as VarDecls + return ParseLocation(); } - return ParseVariable( - getParseTypeUsage(declaration->getTypeSourceInfo()->getTypeLoc(), declaration->getType()), - hameHierarchy, - isStatic + const clang::SourceManager& sourceManager = m_context->getSourceManager(); + + const clang::PresumedLoc& presumedBegin = sourceManager.getPresumedLoc(sourceRange.getBegin(), false); + const clang::PresumedLoc& presumedEnd = sourceManager.getPresumedLoc(sourceRange.getEnd(), false); + + return ParseLocation( + presumedBegin.getFilename(), + presumedBegin.getLine(), + presumedBegin.getColumn(), + presumedEnd.getLine(), + presumedEnd.getColumn() ); } - -ParseFunction ASTVisitor::getParseFunction(const clang::FunctionDecl* declaration) -{ - bool isStatic = false; - bool isConst = false; - - if (clang::isa(declaration)) - { - const clang::CXXMethodDecl* methodDecl = clang::dyn_cast(declaration); - isStatic = methodDecl->isStatic(); - isConst = methodDecl->isConst(); - } - else - { - isStatic = declaration->getStorageClass() == clang::SC_Static; - } - - return ParseFunction( - getParseTypeUsageOfReturnType(declaration), - getDeclNameHierarchy(declaration), - getParameters(declaration), - isStatic, - isConst - ); -} - -ParseFunction ASTVisitor::getParseFunction(const clang::FunctionTemplateDecl* declaration) -{ - return getParseFunction(declaration->getTemplatedDecl()); -} - -NameHierarchy ASTVisitor::getDeclNameHierarchy(const clang::Decl* decl) -{ - NameHierarchy nameHierarchy; - std::unordered_map::const_iterator it = m_nameCache.find(decl); - if (it != m_nameCache.end()) - { - nameHierarchy = it->second; - } - else - { - nameHierarchy = utility::getDeclNameHierarchy(decl); - m_nameCache[decl] = nameHierarchy; - } - return nameHierarchy; -} diff --git a/src/lib_parser/data/parser/cxx/ASTVisitor.h b/src/lib_parser/data/parser/cxx/ASTVisitor.h index 89610a59..3a055f51 100644 --- a/src/lib_parser/data/parser/cxx/ASTVisitor.h +++ b/src/lib_parser/data/parser/cxx/ASTVisitor.h @@ -4,108 +4,320 @@ #include #include "clang/AST/ASTContext.h" -#include "clang/AST/RecursiveASTVisitor.h" +#include +#include +#include +#include "data/parser/ParserClient.h" #include "utility/file/FileRegister.h" -#include "data/parser/cxx/ASTBodyVisitorClient.h" -#include "data/parser/ParserClient.h" -class ASTVisitor - : public clang::RecursiveASTVisitor - , public ASTBodyVisitorClient + +#include "data/parser/cxx/name_resolver/CxxTypeNameResolver.h" +#include "data/parser/cxx/utilityCxx.h" + +class ASTVisitor: clang::RecursiveASTVisitor { public: - ASTVisitor(clang::ASTContext* context, ParserClient* client, FileRegister* fileRegister); - virtual ~ASTVisitor(); + + class TypeNameCache + { + public: + NameHierarchy getName(const clang::Type* type) + { + if (type) + { + NameHierarchy nameHierarchy; + std::unordered_map::const_iterator it = m_typeNameMap.find(type); + if (it != m_typeNameMap.end()) + { + nameHierarchy = it->second; + } + else + { + CxxTypeNameResolver resolver; + nameHierarchy = resolver.getTypeNameHierarchy(type); + m_typeNameMap[type] = nameHierarchy; + } + return nameHierarchy; + } + return NameHierarchy("global"); + } + + private: + std::unordered_map m_typeNameMap; + }; + + class DeclNameCache + { + public: + NameHierarchy getName(const clang::NamedDecl* decl) + { + if (decl) + { + NameHierarchy nameHierarchy; + std::unordered_map::const_iterator it = m_declNameCache.find(decl); + if (it != m_declNameCache.end()) + { + nameHierarchy = it->second; + } + else + { + nameHierarchy = utility::getDeclNameHierarchy(decl); + m_declNameCache[decl] = nameHierarchy; + } + return nameHierarchy; + } + return NameHierarchy("global"); + } + + private: + std::unordered_map m_declNameCache; + }; + + class ContextNameGenerator + { + public: + virtual ~ContextNameGenerator() {} + virtual NameHierarchy getName() const = 0; + }; + + class ContextDeclNameGenerator: public ContextNameGenerator + { + public: + ContextDeclNameGenerator(const clang::NamedDecl* decl, std::shared_ptr nameCache) + : m_decl(decl) + , m_nameCache(nameCache) + {} + + virtual ~ContextDeclNameGenerator() {} + + virtual NameHierarchy getName() const + { + return m_nameCache->getName(m_decl); + } + private: + const clang::NamedDecl* m_decl; + std::shared_ptr m_nameCache; + }; + + class ContextTypeNameGenerator: public ContextNameGenerator + { + public: + ContextTypeNameGenerator(const clang::Type* type, std::shared_ptr nameCache) + : m_type(type) + , m_nameCache(nameCache) + {} + + virtual ~ContextTypeNameGenerator() {} + + virtual NameHierarchy getName() const + { + return m_nameCache->getName(m_type); + } + private: + const clang::Type* m_type; + std::shared_ptr m_nameCache; + }; + + + + + ASTVisitor(clang::ASTContext* context, clang::Preprocessor* preprocessor, ParserClient* client, FileRegister* fileRegister); // Left for debugging purposes. Uncomment to see a colored ast-dump of the parsed file. - // virtual bool VisitTranslationUnitDecl(clang::TranslationUnitDecl* decl) - // { - // decl->dump(); - // return true; - // } + virtual bool VisitTranslationUnitDecl(clang::TranslationUnitDecl* decl); - // RecursiveASTVisitor implementation - virtual bool VisitStmt(const clang::Stmt* statement); // avoid visiting - virtual bool VisitTypedefDecl(clang::TypedefDecl* declaration); // typedefs - virtual bool VisitRecordDecl(clang::RecordDecl* declaration); - virtual bool VisitVarDecl(clang::VarDecl* declaration); // global variables and static fields - virtual bool VisitFieldDecl(clang::FieldDecl* declaration); // fields - virtual bool VisitFunctionDecl(clang::FunctionDecl* declaration); // functions - virtual bool VisitLambdaExpr(clang::LambdaExpr* expr); // lambdas - virtual bool VisitParmVarDecl(clang::ParmVarDecl* declaration); - virtual bool VisitCXXMethodDecl(clang::CXXMethodDecl* declaration); // methods - virtual bool VisitCXXConstructorDecl(clang::CXXConstructorDecl* declaration); // initialization list - virtual bool VisitNamespaceDecl(clang::NamespaceDecl* declaration); // namespaces - virtual bool VisitEnumDecl(clang::EnumDecl* declaration); // enums - virtual bool VisitEnumConstantDecl(clang::EnumConstantDecl* declaration); // enum fields - - virtual bool VisitTemplateTypeParmDecl(clang::TemplateTypeParmDecl *declaration); - virtual bool VisitTemplateTemplateParmDecl(clang::TemplateTemplateParmDecl *declaration); - virtual bool VisitClassTemplateDecl(clang::ClassTemplateDecl* declaration); - virtual bool VisitClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl* declaration); - virtual bool VisitFunctionTemplateDecl(clang::FunctionTemplateDecl *declaration); - - // ASTBodyVisitorClient implementation - virtual void VisitCallExprInDeclBody(clang::FunctionDecl* decl, clang::CallExpr* expr); // calls - virtual void VisitCallExprInDeclBody(clang::DeclaratorDecl* decl, clang::CallExpr* expr); // calls in initialization of global variables - virtual void VisitDeclRefExprInDeclBody(clang::FunctionDecl* decl, clang::DeclRefExpr* expr); - virtual void VisitDeclRefExprInDeclBody(clang::DeclaratorDecl* decl, clang::DeclRefExpr* expr); - virtual void VisitCXXConstructExprInDeclBody(clang::FunctionDecl* decl, clang::CXXConstructExpr* expr); // constructor calls - virtual void VisitCXXConstructExprInDeclBody(clang::DeclaratorDecl* decl, clang::CXXConstructExpr* expr); // constructor calls of global variables - virtual void VisitExplicitCastExprInDeclBody(clang::FunctionDecl* decl, clang::ExplicitCastExpr* expr); - virtual void VisitExplicitCastExprInDeclBody(clang::DeclaratorDecl* decl, clang::ExplicitCastExpr* expr); - virtual void VisitCXXTemporaryObjectExprInDeclBody(clang::FunctionDecl* decl, clang::CXXTemporaryObjectExpr* expr); - virtual void VisitCXXTemporaryObjectExprInDeclBody(clang::DeclaratorDecl* decl, clang::CXXTemporaryObjectExpr* expr); - virtual void VisitCXXNewExprInDeclBody(clang::FunctionDecl* decl, clang::CXXNewExpr* expr); // type use of new operator - virtual void VisitCXXNewExprInDeclBody(clang::DeclaratorDecl* decl, clang::CXXNewExpr* expr); // type use of new operator in global space - virtual void VisitMemberExprInDeclBody(clang::FunctionDecl* decl, clang::MemberExpr* expr); // field usages - virtual void VisitMemberExprInDeclBody(clang::DeclaratorDecl* decl, clang::MemberExpr* expr); // field usages - virtual void VisitGlobalVariableExprInDeclBody(clang::FunctionDecl* decl, clang::DeclRefExpr* expr); // global variable usage - virtual void VisitGlobalVariableExprInDeclBody(clang::DeclaratorDecl* decl, clang::DeclRefExpr* expr); // global variable usage - virtual void VisitEnumExprInDeclBody(clang::FunctionDecl* decl, clang::DeclRefExpr* expr); // enum field usage - virtual void VisitEnumExprInDeclBody(clang::DeclaratorDecl* decl, clang::DeclRefExpr* expr); // enum field usage in global variable - virtual void VisitVarDeclInDeclBody(clang::FunctionDecl* decl, clang::VarDecl* varDecl); // type usages + void indexDecl(clang::Decl *d) { TraverseDecl(d); } private: - void processFunctionDecl(clang::FunctionDecl* declaration); - void processTemplateArgumentsOfExplicitSpecialization(clang::FunctionDecl* declaration); - void processTemplateArgumentsOfExplicitSpecialization(clang::ClassTemplateSpecializationDecl* specializationDecl); - void processTemplateArguments(clang::DeclRefExpr* expr); - void processTemplateArguments(clang::TypeLoc loc); + typedef clang::RecursiveASTVisitor base; + friend class clang::RecursiveASTVisitor; - bool isLocatedInUnparsedProjectFile(const clang::Decl* declaration) const; - bool isLocatedInProjectFile(const ParseLocation& location) const; - bool isLocatedInProjectFile(const clang::Decl* declaration) const; + // XXX: The CF_Read flag is useful mostly for lvalues -- for rvalues, we + // don't set the CF_Read flag, but the rvalue is assumed to be read anyway. - ParserClient::AccessType convertAccessType(clang::AccessSpecifier) const; - ParserClient::AbstractionType getAbstractionType(const clang::CXXMethodDecl* methodDecl) const; + enum ContextFlags { + CF_Called = 0x1, // the value is read only to be called + CF_Read = 0x2, // the value is read for any other use + CF_AddressTaken = 0x4, // the gl-value's address escapes + CF_Assigned = 0x8, // the gl-value is assigned to + CF_Modified = 0x10 // the gl-value is updated (i.e. compound assignment) + }; - ParseLocation getParseLocation(const clang::SourceRange& sourceRange) const; - ParseLocation getParseLocationForTokenAtLocation(const clang::SourceLocation& loc) const; - ParseLocation getParseLocationForTokensInRange(const clang::SourceRange& range) const; - ParseLocation getParseLocationForNamedDecl(const clang::NamedDecl* decl) const; - ParseLocation getParseLocationOfFunctionBody(const clang::FunctionDecl* decl) const; - ParseLocation getParseLocationOfRecordBody(clang::RecordDecl* decl) const; + enum RefType : int { + RT_AddressTaken, + RT_Assigned, + RT_BaseClass, + RT_Called, + RT_Declaration, + RT_DefinedTest, + RT_Definition, + RT_Expansion, + RT_Included, + RT_Initialized, + RT_Modified, + RT_NamespaceAlias, + RT_Other, + RT_Qualifier, + RT_Read, + RT_Reference, + RT_TemplateArgument, + RT_TemplateDefaultArgument, + RT_Undefinition, + RT_Using, + RT_UsingDirective, + RT_Max + }; - ParseTypeUsage getParseTypeUsage(const clang::TypeLoc& typeLoc, const clang::QualType& type) const; - ParseTypeUsage getParseTypeUsage(const clang::TypeLoc& typeLoc, const std::shared_ptr type) const; - ParseTypeUsage getParseTypeUsage(const clang::SourceRange& sourceRange, const std::shared_ptr type) const; - ParseTypeUsage getParseTypeUsageOfReturnType(const clang::FunctionDecl* declaration) const; - std::vector getParameters(const clang::FunctionDecl* declaration) const; + enum SymbolType : int { // we dont need this. decl already knows it! + ST_Class, + ST_ClassTemplateSpecialization, + ST_Constructor, + ST_Destructor, + ST_Enum, + ST_Enumerator, + ST_Field, + ST_Function, + ST_FunctionTemplateSpecialization, + ST_GlobalVariable, + ST_LocalVariable, + ST_Macro, + ST_Method, + ST_Namespace, + ST_Parameter, + ST_Path, + ST_Struct, + ST_Typedef, + ST_TemplateParameter, + ST_Union, + ST_Max + }; - ParseVariable getParseVariable(const clang::DeclaratorDecl* declaration); - ParseFunction getParseFunction(const clang::FunctionDecl* declaration); - ParseFunction getParseFunction(const clang::FunctionTemplateDecl* declaration); + struct Location { + unsigned int fileID; + unsigned int line; // 1-based + int column; // 1-based + }; - NameHierarchy getDeclNameHierarchy(const clang::Decl* decl); + typedef unsigned int Context; clang::ASTContext* m_context; + clang::Preprocessor* m_preprocessor; ParserClient* m_client; FileRegister* m_fileRegister; - std::unordered_map m_nameCache; + + Context m_thisContext; + Context m_childContext; + RefType m_typeContext; + + // Misc routines + bool shouldVisitTemplateInstantiations() const { return true; } + bool shouldUseDataRecursionFor(clang::Stmt *s) const; + + // Dispatcher routines + bool TraverseStmt(clang::Stmt *stmt); + bool TraverseType(clang::QualType t); + bool TraverseTypeLoc(clang::TypeLoc tl); + bool TraverseDecl(clang::Decl *d); + bool TraverseLambdaExpr(clang::LambdaExpr* e); + bool TraverseFunctionDecl(clang::FunctionDecl* d); + bool TraverseTypedefDecl(clang::TypedefDecl *d); + bool TraverseFieldDecl(clang::FieldDecl *d); + bool TraverseVarDecl(clang::VarDecl *d); + bool TraverseClassTemplateDecl(clang::ClassTemplateDecl* d); + bool TraverseTemplateTypeParmDecl(clang::TemplateTypeParmDecl* d); + bool TraverseTemplateTemplateParmDecl(clang::TemplateTemplateParmDecl* d); + bool TraverseClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl* d); + bool TraverseDeclRefExpr(clang::DeclRefExpr* expr); + bool TraverseTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc loc); + bool TraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc); + + // Expression context propagation + bool TraverseCallExpr(clang::CallExpr *e) { return TraverseCallCommon(e); } + bool TraverseCXXMemberCallExpr(clang::CXXMemberCallExpr *e) { return TraverseCallCommon(e); } + bool TraverseCXXOperatorCallExpr(clang::CXXOperatorCallExpr *e) { return TraverseCallCommon(e); } + bool TraverseBinComma(clang::BinaryOperator *s); + bool TraverseBinAssign(clang::BinaryOperator *e) { return TraverseAssignCommon(e, CF_Assigned); } +#define OPERATOR(NAME) bool TraverseBin##NAME##Assign(clang::CompoundAssignOperator *e) { return TraverseAssignCommon(e, CF_Modified); } + OPERATOR(Mul) OPERATOR(Div) OPERATOR(Rem) OPERATOR(Add) OPERATOR(Sub) + OPERATOR(Shl) OPERATOR(Shr) OPERATOR(And) OPERATOR(Or) OPERATOR(Xor) +#undef OPERATOR + bool VisitParenExpr(clang::ParenExpr *e) { m_childContext = m_thisContext; return true; } + bool VisitCastExpr(clang::CastExpr *e); + bool VisitUnaryAddrOf(clang::UnaryOperator *e); + bool VisitUnaryDeref(clang::UnaryOperator *e); + bool VisitDeclStmt(clang::DeclStmt *s); + bool VisitReturnStmt(clang::ReturnStmt *s); + bool VisitVarDecl(clang::VarDecl *d); + bool VisitInitListExpr(clang::InitListExpr *e); + bool TraverseConstructorInitializer(clang::CXXCtorInitializer *init); + bool TraverseCallCommon(clang::CallExpr *call); + bool TraverseAssignCommon(clang::BinaryOperator *e, ContextFlags lhsFlag); + + // Expression reference recording + bool VisitLambdaExpr(clang::LambdaExpr* e); + bool VisitMemberExpr(clang::MemberExpr *e); + bool VisitDeclRefExpr(clang::DeclRefExpr *e); + bool VisitCXXConstructExpr(clang::CXXConstructExpr *e); + void RecordDeclRefExpr(clang::NamedDecl *d, clang::SourceLocation loc, clang::Expr *e, Context context); + + // NestedNameSpecifier handling + bool TraverseNestedNameSpecifierLoc(clang::NestedNameSpecifierLoc qualifier); + + // Declaration and TypeLoc handling + void traverseDeclContextHelper(clang::DeclContext *d); + bool TraverseCXXRecordDecl(clang::CXXRecordDecl *d); + bool TraverseNamespaceAliasDecl(clang::NamespaceAliasDecl *d); + bool TraverseClassTemplateSpecializationDecl( + clang::ClassTemplateSpecializationDecl *d); + void templateParameterListsHelper(clang::DeclaratorDecl *d); + bool VisitDecl(clang::Decl *d); + bool VisitTypeLoc(clang::TypeLoc tl); + + // Reference recording + ParseLocation getDeclRefRange( + clang::NamedDecl *decl, + clang::SourceLocation loc); + + void RecordTypeRef( + const clang::Type* type, + clang::SourceLocation beginLoc, + RefType refType, + SymbolType symbolType = ST_Max); + + void RecordDeclRef( + clang::NamedDecl *d, + clang::SourceLocation beginLoc, + RefType refType, + SymbolType symbolType = ST_Max); + + bool isLocatedInUnparsedProjectFile(clang::SourceLocation loc); + bool isLocatedInProjectFile(clang::SourceLocation loc); + + ParserClient::AccessType convertAccessType(clang::AccessSpecifier access) const; + ParserClient::AbstractionType getAbstractionType(const clang::CXXMethodDecl* methodDecl) const; + ParseLocation getParseLocationOfRecordBody(clang::RecordDecl* decl) const; + ParseLocation getParseLocationOfFunctionBody(const clang::FunctionDecl* decl) const; + ParseLocation getParseLocation(const clang::SourceRange& sourceRange) const; + + struct FileIdHash { + size_t operator()(clang::FileID fileID) const { + return fileID.getHashValue(); + } + }; + + std::unordered_map m_inUnparsedProjectFileMap; + std::unordered_map m_inProjectFileMap; + + std::shared_ptr m_contextNameGenerator; + std::shared_ptr m_childContextNameGenerator; + + std::shared_ptr m_declNameCache; + std::shared_ptr m_typeNameCache; + + ParserClient::AccessType m_contextAccess; }; #endif // AST_VISITOR_H diff --git a/src/lib_parser/data/parser/cxx/name_resolver/CxxDeclNameResolver.cpp b/src/lib_parser/data/parser/cxx/name_resolver/CxxDeclNameResolver.cpp index 64f6e691..2b29e2e9 100644 --- a/src/lib_parser/data/parser/cxx/name_resolver/CxxDeclNameResolver.cpp +++ b/src/lib_parser/data/parser/cxx/name_resolver/CxxDeclNameResolver.cpp @@ -54,7 +54,7 @@ NameHierarchy CxxDeclNameResolver::getContextNameHierarchy(const clang::DeclCont { NameHierarchy contextNameHierarchy; - if (!ignoresContext(declContext)) + if (declContext && !ignoresContext(declContext)) { const clang::DeclContext* parentContext = declContext->getParent(); if (parentContext) @@ -139,7 +139,7 @@ std::shared_ptr CxxDeclNameResolver::getDeclName() const clang::SourceManager& sourceManager = declaration->getASTContext().getSourceManager(); const clang::PresumedLoc& presumedBegin = sourceManager.getPresumedLoc(recordDecl->getLocStart()); std::string lambdaName = "lambda at " + std::to_string(presumedBegin.getLine()) + ":" + std::to_string(presumedBegin.getColumn()); - return std::make_shared(lambdaName, lambdaName); + return std::make_shared(lambdaName, NameElement::Signature("void", "()")); } else if (declNameString.size() == 0) { @@ -160,15 +160,16 @@ std::shared_ptr CxxDeclNameResolver::getDeclName() } } - const clang::FunctionDecl* functionDecl = clang::dyn_cast(declaration); + std::string functionName; + const clang::FunctionDecl* functionDecl = clang::dyn_cast(declaration); if (clang::FunctionTemplateDecl* templateFunctionDeclaration = functionDecl->getDescribedFunctionTemplate()) { - return getDeclName(templateFunctionDeclaration); + functionName = getDeclName(templateFunctionDeclaration)->getName(); } - else + else { - std::string functionName = declNameString; + functionName = declNameString; if (functionDecl->isFunctionTemplateSpecialization()) { std::string templateArgumentNamePart = "<"; @@ -182,40 +183,40 @@ std::shared_ptr CxxDeclNameResolver::getDeclName() templateArgumentNamePart += ">"; functionName += templateArgumentNamePart; } - - bool isStatic = false; - bool isConst = false; - - if (clang::isa(declaration)) - { - const clang::CXXMethodDecl* methodDecl = clang::dyn_cast(declaration); - isStatic = methodDecl->isStatic(); - isConst = methodDecl->isConst(); - } - else - { - isStatic = functionDecl->getStorageClass() == clang::SC_Static; - } - - CxxTypeNameResolver typenNameResolver(getIgnoredContextDecls()); - typenNameResolver.ignoreContextDecl(functionDecl); - std::string returnTypeString = typenNameResolver.qualTypeToDataType(functionDecl->getReturnType())->getFullTypeName(); - - std::string parameterString = "("; - for (unsigned int i = 0; i < functionDecl->param_size(); i++) - { - parameterString += typenNameResolver.qualTypeToDataType(functionDecl->parameters()[i]->getType())->getFullTypeName(); - if (i < functionDecl->param_size() - 1) - { - parameterString += ", "; - } - } - parameterString += ")"; - - return std::make_shared( - functionName, - (isStatic ? "static " : "") + returnTypeString + " " + functionName + parameterString + (isConst ? " const" : "")); } + + bool isStatic = false; + bool isConst = false; + + if (clang::isa(declaration)) + { + const clang::CXXMethodDecl* methodDecl = clang::dyn_cast(declaration); + isStatic = methodDecl->isStatic(); + isConst = methodDecl->isConst(); + } + else + { + isStatic = functionDecl->getStorageClass() == clang::SC_Static; + } + + CxxTypeNameResolver typenNameResolver(getIgnoredContextDecls()); + typenNameResolver.ignoreContextDecl(functionDecl); + std::string returnTypeString = typenNameResolver.qualTypeToDataType(functionDecl->getReturnType())->getFullTypeName(); + + std::string parameterString = "("; + for (unsigned int i = 0; i < functionDecl->param_size(); i++) + { + if (i > 0) + { + parameterString += ", "; + } + parameterString += typenNameResolver.qualTypeToDataType(functionDecl->parameters()[i]->getType())->getFullTypeName(); + } + parameterString += ")"; + + return std::make_shared( + functionName, + NameElement::Signature((isStatic ? "static " : "") + returnTypeString, parameterString + (isConst ? " const" : ""))); } else if (clang::isa(declaration)) // also triggers on TemplateTemplateParmDecl diff --git a/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.cpp b/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.cpp index 2a14aeed..e1e5b27d 100644 --- a/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.cpp +++ b/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.cpp @@ -134,11 +134,11 @@ std::shared_ptr CxxTypeNameResolver::typeToDataType(const clang::Type* } templateArgumentNamePart += ">"; - std::string declName = typeNameHerarchy.back()->getFullName(); + std::string declName = typeNameHerarchy.back()->getName(); declName = declName.substr(0, declName.rfind("<")); // remove template parameters declName += templateArgumentNamePart; // add template arguments typeNameHerarchy.pop(); - typeNameHerarchy.push(std::make_shared(declName)); + typeNameHerarchy.push(std::make_shared(declName)); // templateSpecialization has no signature. } } dataType = std::make_shared(typeNameHerarchy); @@ -219,6 +219,11 @@ std::shared_ptr CxxTypeNameResolver::typeToDataType(const clang::Type* return dataType; } +NameHierarchy CxxTypeNameResolver::getTypeNameHierarchy(const clang::Type* type) +{ + return typeToDataType(type)->getTypeNameHierarchy(); +} + NameHierarchy CxxTypeNameResolver::getNameHierarchy(const clang::NestedNameSpecifier* nestedNameSpecifier) { clang::NestedNameSpecifier::SpecifierKind nnsKind = nestedNameSpecifier->getKind(); diff --git a/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.h b/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.h index 6f32e49e..0c94e9c1 100644 --- a/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.h +++ b/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.h @@ -12,6 +12,7 @@ public: virtual ~CxxTypeNameResolver(); std::shared_ptr qualTypeToDataType(clang::QualType qualType); + NameHierarchy getTypeNameHierarchy(const clang::Type* type); private: std::shared_ptr typeToDataType(const clang::Type* type); diff --git a/src/test/CxxParserTestSuite.h b/src/test/CxxParserTestSuite.h index ee307027..2684b9af 100644 --- a/src/test/CxxParserTestSuite.h +++ b/src/test/CxxParserTestSuite.h @@ -18,6 +18,9 @@ class CxxParserTestSuite: public CxxTest::TestSuite { public: +/////////////////////////////////////////////////////////////////////////////// +// test finding symbol definitions and declarations + void test_cxx_parser_finds_global_class_definition() { std::shared_ptr client = parseCode( @@ -30,7 +33,7 @@ public: TS_ASSERT_EQUALS(client->classes[0], "A <1:1 <1:7 1:7> 3:1>"); } - void test_cxx_parser_finds_global_class_forward_declaration() + void test_cxx_parser_finds_global_class_declaration() { std::shared_ptr client = parseCode( "class A;\n" @@ -40,7 +43,695 @@ public: TS_ASSERT_EQUALS(client->classes[0], "A <1:7 1:7>"); } - void test_cxx_parser_finds_nested_class_definition() + void test_cxx_parser_finds_global_struct_definition() + { + std::shared_ptr client = parseCode( + "struct A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->structs.size(), 1); + TS_ASSERT_EQUALS(client->structs[0], "A <1:1 <1:8 1:8> 3:1>"); + } + + void test_cxx_parser_finds_global_struct_declaration() + { + std::shared_ptr client = parseCode( + "struct A;\n" + ); + + TS_ASSERT_EQUALS(client->structs.size(), 1); + TS_ASSERT_EQUALS(client->structs[0], "A <1:8 1:8>"); + } + + void test_cxx_parser_finds_variable_definitions_in_global_scope() + { + std::shared_ptr client = parseCode( + "int x;\n" + ); + + TS_ASSERT_EQUALS(client->globalVariables.size(), 1); + TS_ASSERT_EQUALS(client->globalVariables[0], "x <1:5 1:5>"); + } + + void test_cxx_parser_finds_fields_in_class_with_access_type() + { + std::shared_ptr client = parseCode( + "class A\n" + "{\n" + " int a;" + "public:\n" + " A() : d(0) {};\n" + " int b;" + "protected:\n" + " static int c;\n" + "private:\n" + " const int d;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->fields.size(), 4); + TS_ASSERT_EQUALS(client->fields[0], "private A::a <3:6 3:6>"); + TS_ASSERT_EQUALS(client->fields[1], "public A::b <5:6 5:6>"); + TS_ASSERT_EQUALS(client->fields[2], "protected A::c <6:13 6:13>"); + TS_ASSERT_EQUALS(client->fields[3], "private A::d <8:12 8:12>"); + } + + void test_cxx_parser_finds_function_declaration() + { + std::shared_ptr client = parseCode( + "int ceil(float a)\n" + "{\n" + " return 1;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->functions.size(), 1); + TS_ASSERT_EQUALS(client->functions[0], "int ceil(float) <1:1 <1:5 1:8> 4:1>"); + } + + void test_cxx_parser_finds_static_function_declaration() + { + std::shared_ptr client = parseCode( + "static int ceil(float a)\n" + "{\n" + " return static_cast(a) + 1;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->functions.size(), 1); + TS_ASSERT_EQUALS(client->functions[0], "static int ceil(float) <1:1 <1:12 1:15> 4:1>"); + } + + void test_cxx_parser_finds_method_declaration() + { + std::shared_ptr client = parseCode( + "class B\n" + "{\n" + "public:\n" + " B();\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->methods.size(), 1); + TS_ASSERT_EQUALS(client->methods[0], "public void B::B() <4:2 4:2>"); + } + + void test_cxx_parser_finds_method_declaration_and_definition() + { + std::shared_ptr client = parseCode( + "class B\n" + "{\n" + "public:\n" + " B();\n" + "};\n" + "B::B()\n" + "{\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->methods.size(), 2); + TS_ASSERT_EQUALS(client->methods[0], "public void B::B() <4:2 4:2>"); + TS_ASSERT_EQUALS(client->methods[1], "public void B::B() <6:1 <6:4 6:4> 8:1>"); + } + + void test_cxx_parser_finds_virtual_method_declaration() + { + std::shared_ptr client = parseCode( + "class B\n" + "{\n" + "public:\n" + " virtual void process();\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->methods.size(), 1); + TS_ASSERT_EQUALS(client->methods[0], "public virtual void B::process() <4:15 4:21>"); + } + + void test_cxx_parser_finds_pure_virtual_method_declaration() + { + std::shared_ptr client = parseCode( + "class B\n" + "{\n" + "protected:\n" + " virtual void process() = 0;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->methods.size(), 1); + TS_ASSERT_EQUALS(client->methods[0], "protected pure virtual void B::process() <4:15 4:21>"); + } + + void test_cxx_parser_finds_named_namespace_declaration() + { + std::shared_ptr client = parseCode( + "namespace A\n" + "{\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->namespaces.size(), 1); + TS_ASSERT_EQUALS(client->namespaces[0], "A <1:1 <1:11 1:11> 3:1>"); + } + + void test_cxx_parser_finds_anonymous_namespace_declaration() + { + std::shared_ptr client = parseCode( + "namespace\n" + "{\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->namespaces.size(), 1); + TS_ASSERT_EQUALS(client->namespaces[0], "anonymous namespace (input.cc) <1:1 3:1>"); + } + + void test_cxx_parser_finds_enum_defined_in_global_namespace() + { + std::shared_ptr client = parseCode( + "enum E\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->enums.size(), 1); + TS_ASSERT_EQUALS(client->enums[0], "E <1:1 <1:6 1:6> 3:1>"); + } + + void test_cxx_parser_finds_enum_constant_in_global_enum() + { + std::shared_ptr client = parseCode( + "enum E\n" + "{\n" + " P\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->enumConstants.size(), 1); + TS_ASSERT_EQUALS(client->enumConstants[0], "E::P <3:2 3:2>"); + } + + void test_cxx_parser_finds_typedef_in_global_namespace() + { + std::shared_ptr client = parseCode( + "typedef unsigned int uint;\n" + ); + + TS_ASSERT_EQUALS(client->typedefs.size(), 1); + TS_ASSERT_EQUALS(client->typedefs[0], "uint <1:22 1:25>"); + } + + void test_cxx_parser_finds_typedef_in_named_namespace() + { + std::shared_ptr client = parseCode( + "namespace test\n" + "{\n" + " typedef unsigned int uint;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->typedefs.size(), 1); + TS_ASSERT_EQUALS(client->typedefs[0], "test::uint <3:23 3:26>"); + } + + void test_cxx_parser_finds_typedef_in_anonymous_namespace() + { + std::shared_ptr client = parseCode( + "namespace\n" + "{\n" + " typedef unsigned int uint;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->typedefs.size(), 1); + TS_ASSERT_EQUALS(client->typedefs[0], "anonymous namespace (input.cc)::uint <3:23 3:26>"); + } + + void test_cxx_parser_finds_macro_define() + { + std::shared_ptr client = parseCode( + "#define PI\n" + "void test()\n" + "{\n" + "};\n" + ); + TS_ASSERT_EQUALS(client->macros.size(), 1); + TS_ASSERT_EQUALS(client->macros[0], "PI <1:9 <1:9 1:10> 1:8>"); + } + + void test_cxx_parser_finds_type_template_parameter_type_of_template_class() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:20 1:20>"); + } + + void test_cxx_parser_finds_type_template_parameter_defined_with_class_keyword() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:17 1:17>"); + } + + void test_cxx_parser_finds_non_type_int_template_parameter_of_template_class() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:15 1:15>"); + } + + void test_cxx_parser_finds_non_type_bool_template_parameter_of_template_class() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:16 1:16>"); + } + + void test_cxx_parser_finds_non_type_custom_pointer_template_parameter_of_template_class() + { + std::shared_ptr client = parseCode( + "class P\n" + "{};\n" + "template \n" + "class A\n" + "{};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A

::p <3:14 3:14>"); + } + + void test_cxx_parser_finds_non_type_custom_reference_template_parameter_of_template_class() + { + std::shared_ptr client = parseCode( + "class P\n" + "{};\n" + "template \n" + "class A\n" + "{};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A

::p <3:14 3:14>"); + } + + void test_cxx_parser_finds_non_type_template_parameter_that_depends_on_type_template_parameter_of_template_class() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T1 <1:20 1:21>"); + TS_ASSERT_EQUALS(client->templateParameterTypes[1], "A::T2 <1:28 1:29>"); + } + + void test_cxx_parser_finds_non_type_template_parameter_that_depends_on_template_template_parameter_of_template_class() + { + std::shared_ptr client = parseCode( + "template class T1, T1& T2>\n" + "class A\n" + "{};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A typename T1, T1 & T2>::T1 <1:36 1:37>"); + TS_ASSERT_EQUALS(client->templateParameterTypes[1], "A typename T1, T1 & T2>::T2 <1:49 1:50>"); + } + + //void _test_cxx_parser_finds_template_argument_of_dependent_non_type_template_parameter() + //{ + // std::shared_ptr client = parseCode( + // "template class T1, T1& T2>\n" // test that t1 uses int + // "class A\n" + // "{};\n" + // ); + //} + + void test_cxx_parser_finds_template_template_parameter_of_template_class() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{};\n" + "template class T>\n" + "class B\n" + "{};\n" + "int main()\n" + "{\n" + " B ba;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:20 1:20>"); + TS_ASSERT_EQUALS(client->templateParameterTypes[1], "B typename T>::T <4:36 4:36>"); + } + + void test_cxx_parser_finds_type_template_parameter_pack_type_of_template_class() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:23 1:23>"); + } + + + + void test_cxx_parser_finds_non_type_int_template_parameter_pack_type_of_template_class() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:18 1:18>"); + } + + void test_cxx_parser_finds_template_template_parameter_pack_type_of_template_class() + { + std::shared_ptr client = parseCode( + "template typename... T>\n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A typename... T>::T <1:42 1:42>"); + } + + void test_cxx_parser_finds_type_template_parameters_of_template_class_with_multiple_parameters() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:20 1:20>"); + TS_ASSERT_EQUALS(client->templateParameterTypes[1], "A::U <1:32 1:32>"); + } + + void test_cxx_parser_skips_creating_node_for_template_parameter_without_a_name() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->classes.size(), 1); + TS_ASSERT_EQUALS(client->classes[0], "A <1:1 <2:7 2:7> 4:1>"); + } + + void test_cxx_parser_finds_type_template_parameter_of_template_method_definition_outside_template_class() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + " template \n" + " U foo();\n" + "};\n" + "template \n" + "template \n" + "U A::foo()\n" + "{}\n" + ); + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 3); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::foo::U <4:21 4:21>"); + TS_ASSERT_EQUALS(client->templateParameterTypes[1], "A::T <1:20 1:20>"); + TS_ASSERT_EQUALS(client->templateParameterTypes[2], "A::foo::U <8:20 8:20>"); + } + + void test_cxx_parser_finds_class_of_explicit_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template <>\n" + "class A\n" + "{\n" + "};\n" + ); + TS_ASSERT_EQUALS(client->classes.size(), 2); + TS_ASSERT_EQUALS(client->classes[0], "A <1:1 <2:7 2:7> 4:1>"); + TS_ASSERT_EQUALS(client->classes[1], "A <5:1 <6:7 6:7> 8:1>"); + } + + void test_cxx_parser_finds_class_of_explicit_partial_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template \n" + "class A\n" + "{\n" + "};\n" + ); + TS_ASSERT_EQUALS(client->classes.size(), 2); + TS_ASSERT_EQUALS(client->classes[0], "A <1:1 <2:7 2:7> 4:1>"); + TS_ASSERT_EQUALS(client->classes[1], "A <5:1 <6:7 6:7> 8:1>"); + } + + void test_cxx_parser_finds_correct_name_of_explicit_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->classes.size(), 2); + TS_ASSERT_EQUALS(client->classes[0], "A <1:1 <2:7 2:7> 4:1>"); + TS_ASSERT_EQUALS(client->classes[1], "A <5:1 <6:7 6:7> 8:1>"); + } + + void test_cxx_parser_finds_correct_field_member_name_of_template_class_in_declaration() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + " int foo;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->fields.size(), 1); + TS_ASSERT_EQUALS(client->fields[0], "private A::foo <4:6 4:8>"); + } + + void test_cxx_parser_finds_correct_type_of_field_member_of_template_class_in_declaration() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + " T foo;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->fields.size(), 1); + TS_ASSERT_EQUALS(client->fields[0], "private A::foo <4:4 4:6>"); + } + + void test_cxx_parser_finds_correct_method_member_name_of_template_class_in_declaration() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + " int foo();\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->methods.size(), 1); + TS_ASSERT_EQUALS(client->methods[0], "private int A::foo() <4:6 4:8>"); + } + + void test_cxx_parser_finds_type_template_parameter_of_template_function() + { + std::shared_ptr client = parseCode( + "template \n" + "T test(T a)\n" + "{\n" + " return a;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test::T <1:20 1:20>"); + } + + void test_cxx_parser_finds_non_type_int_template_parameter_of_template_function() + { + std::shared_ptr client = parseCode( + "template \n" + "int test(int a)\n" + "{\n" + " return a + T;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test::T <1:15 1:15>"); + } + + void test_cxx_parser_finds_non_type_bool_template_parameter_of_template_function() + { + std::shared_ptr client = parseCode( + "template \n" + "int test(int a)\n" + "{\n" + " return T ? a : 0;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test::T <1:16 1:16>"); + } + + void test_cxx_parser_finds_non_type_custom_pointer_template_parameter_of_template_function() + { + std::shared_ptr client = parseCode( + "class P\n" + "{};\n" + "template \n" + "int test(int a)\n" + "{\n" + " return a;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test

::p <3:14 3:14>"); + } + + void test_cxx_parser_finds_non_type_custom_reference_template_parameter_of_template_function() + { + std::shared_ptr client = parseCode( + "class P\n" + "{};\n" + "template \n" + "int test(int a)\n" + "{\n" + " return a;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test

::p <3:14 3:14>"); + } + + void test_cxx_parser_finds_template_template_parameter_of_template_function() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{};\n" + "template class T>\n" + "int test(int a)\n" + "{\n" + " return a;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:20 1:20>"); + TS_ASSERT_EQUALS(client->templateParameterTypes[1], "test typename T>::T <4:36 4:36>"); + } + + void test_cxx_parser_finds_function_for_implicit_instantiation_of_template_function() + { + std::shared_ptr client = parseCode( + "template \n" + "T test(T a)\n" + "{\n" + " return a;\n" + "};\n" + "\n" + "int main()\n" + "{\n" + " return test(1);\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->functions.size(), 3); + TS_ASSERT_EQUALS(client->functions[0], "T test(T) <1:1 <2:3 2:6> 5:1>"); + TS_ASSERT_EQUALS(client->functions[1], "int test(int) <2:1 <2:3 2:6> 5:1>"); + TS_ASSERT_EQUALS(client->functions[2], "int main() <7:1 <7:5 7:8> 10:1>"); + } + + void test_cxx_parser_finds_lambda_in_function() + { + std::shared_ptr client = parseCode( + "void lambdaCaller()\n" + "{\n" + " [](){}();\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->functions.size(), 2); + TS_ASSERT_EQUALS(client->functions[0], "void lambdaCaller() <1:1 <1:6 1:17> 4:1>"); + TS_ASSERT_EQUALS(client->functions[1], "void lambdaCaller::lambda at 3:2() <3:5 <3:2 3:2> 3:7>"); + TS_ASSERT_EQUALS(client->calls.size(), 1); + TS_ASSERT_EQUALS(client->calls[0], "void lambdaCaller() -> void lambdaCaller::lambda at 3:2() <3:8 3:8>"); + } + + +/////////////////////////////////////////////////////////////////////////////// +// test finding nested symbol definitions and declarations + + void test_cxx_parser_finds_class_definition_in_class() { std::shared_ptr client = parseCode( "class A\n" @@ -68,28 +759,6 @@ public: TS_ASSERT_EQUALS(client->classes[0], "a::B <3:8 3:8>"); } - void test_cxx_parser_finds_global_struct_definition() - { - std::shared_ptr client = parseCode( - "struct A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->structs.size(), 1); - TS_ASSERT_EQUALS(client->structs[0], "A <1:1 <1:8 1:8> 3:1>"); - } - - void test_cxx_parser_finds_global_struct_forward_declaration() - { - std::shared_ptr client = parseCode( - "struct A;\n" - ); - - TS_ASSERT_EQUALS(client->structs.size(), 1); - TS_ASSERT_EQUALS(client->structs[0], "A <1:8 1:8>"); - } - void test_cxx_parser_finds_struct_definition_in_class() { std::shared_ptr client = parseCode( @@ -104,7 +773,7 @@ public: TS_ASSERT_EQUALS(client->structs.size(), 1); TS_ASSERT_EQUALS(client->structs[0], "private A::B <3:2 <3:9 3:9> 5:2>"); } - + void test_cxx_parser_finds_struct_definition_in_namespace() { std::shared_ptr client = parseCode( @@ -142,39 +811,19 @@ public: TS_ASSERT_EQUALS(client->structs[1], "foo::B <9:2 <9:9 9:9> 11:2>"); } - void test_cxx_parser_finds_variable_definitions_in_global_scope() - { - std::shared_ptr client = parseCode( - "int x;\n" - "const int y = 0;\n" - "static int z;\n" - "class A;\n" - "A* b;" - ); - - TS_ASSERT_EQUALS(client->globalVariables.size(), 4); - TS_ASSERT_EQUALS(client->globalVariables[0], "int x <1:5 1:5>"); - TS_ASSERT_EQUALS(client->globalVariables[1], "int const y <2:11 2:11>"); - TS_ASSERT_EQUALS(client->globalVariables[2], "static int z <3:12 3:12>"); - TS_ASSERT_EQUALS(client->globalVariables[3], "A * b <5:4 5:4>"); - } - void test_cxx_parser_finds_variable_definitions_in_namespace_scope() { std::shared_ptr client = parseCode( "namespace n" "{\n" " int x;\n" - " class A;\n" - " A* b;\n" "}\n" - ); + ); - TS_ASSERT_EQUALS(client->globalVariables.size(), 2); - TS_ASSERT_EQUALS(client->globalVariables[0], "int n::x <2:6 2:6>"); - TS_ASSERT_EQUALS(client->globalVariables[1], "n::A * n::b <4:5 4:5>"); + TS_ASSERT_EQUALS(client->globalVariables.size(), 1); + TS_ASSERT_EQUALS(client->globalVariables[0], "n::x <2:6 2:6>"); } - + void test_cxx_parser_finds_field_in_nested_class() { std::shared_ptr client = parseCode( @@ -187,46 +836,10 @@ public: " static const int amount;\n" " };\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->fields.size(), 1); - TS_ASSERT_EQUALS(client->fields[0], "private static int const B::C::amount <7:20 7:25>"); - } - - void test_cxx_parser_finds_fields_in_class_with_access_type() - { - std::shared_ptr client = parseCode( - "class A\n" - "{\n" - " int a;" - "public:\n" - " A() : d(0) {};\n" - " int b;" - "protected:\n" - " static int c;\n" - "private:\n" - " const int d;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->fields.size(), 4); - TS_ASSERT_EQUALS(client->fields[0], "private int A::a <3:6 3:6>"); - TS_ASSERT_EQUALS(client->fields[1], "public int A::b <5:6 5:6>"); - TS_ASSERT_EQUALS(client->fields[2], "protected static int A::c <6:13 6:13>"); - TS_ASSERT_EQUALS(client->fields[3], "private int const A::d <8:12 8:12>"); - } - - void test_cxx_parser_finds_function_in_global_namespace() - { - std::shared_ptr client = parseCode( - "int ceil(float a)\n" - "{\n" - " return 1;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->functions.size(), 1); - TS_ASSERT_EQUALS(client->functions[0], "int ceil(float) <1:1 <1:5 1:8> 4:1>"); + TS_ASSERT_EQUALS(client->fields[0], "private B::C::amount <7:20 7:25>"); } void test_cxx_parser_finds_function_in_anonymous_namespace() @@ -236,85 +849,12 @@ public: "{\n" " int sum(int a, int b);\n" "}\n" - ); + ); TS_ASSERT_EQUALS(client->functions.size(), 1); TS_ASSERT_EQUALS(client->functions[0], "int anonymous namespace (input.cc)::sum(int, int) <3:6 3:8>"); } - void test_cxx_parser_finds_static_function_in_global_namespace() - { - std::shared_ptr client = parseCode( - "static int ceil(float a)\n" - "{\n" - " return static_cast(a) + 1;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->functions.size(), 1); - TS_ASSERT_EQUALS(client->functions[0], "static int ceil(float) <1:1 <1:12 1:15> 4:1>"); - } - - void test_cxx_parser_finds_method_declaration() - { - std::shared_ptr client = parseCode( - "class B\n" - "{\n" - "public:\n" - " B();\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->methods.size(), 1); - TS_ASSERT_EQUALS(client->methods[0], "public void B::B() <4:2 4:2>"); - } - - void test_cxx_parser_finds_method_declaration_and_definition() - { - std::shared_ptr client = parseCode( - "class B\n" - "{\n" - "public:\n" - " B();\n" - "};\n" - "B::B()\n" - "{\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->methods.size(), 2); - TS_ASSERT_EQUALS(client->methods[0], "public void B::B() <4:2 4:2>"); - TS_ASSERT_EQUALS(client->methods[1], "public void B::B() <6:1 <6:4 6:4> 8:1>"); - } - - void test_cxx_parser_finds_virtual_method() - { - std::shared_ptr client = parseCode( - "class B\n" - "{\n" - "public:\n" - " virtual void process();\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->methods.size(), 1); - TS_ASSERT_EQUALS(client->methods[0], "public virtual void B::process() <4:15 4:21>"); - } - - void test_cxx_parser_finds_pure_virtual_method() - { - std::shared_ptr client = parseCode( - "class B\n" - "{\n" - "protected:\n" - " virtual void process() = 0;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->methods.size(), 1); - TS_ASSERT_EQUALS(client->methods[0], "protected pure virtual void B::process() <4:15 4:21>"); - } - void test_cxx_parser_finds_method_declared_in_nested_class() { std::shared_ptr client = parseCode( @@ -325,36 +865,12 @@ public: " bool isGreat() const;\n" " };\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->methods.size(), 1); TS_ASSERT_EQUALS(client->methods[0], "private bool B::C::isGreat() const <5:8 5:14>"); } - void test_cxx_parser_finds_named_namespace() - { - std::shared_ptr client = parseCode( - "namespace A\n" - "{\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->namespaces.size(), 1); - TS_ASSERT_EQUALS(client->namespaces[0], "A <1:1 <1:11 1:11> 3:1>"); - } - - void test_cxx_parser_finds_anonymous_namespace() - { - std::shared_ptr client = parseCode( - "namespace\n" - "{\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->namespaces.size(), 1); - TS_ASSERT_EQUALS(client->namespaces[0], "anonymous namespace (input.cc) <1:1 3:1>"); - } - void test_cxx_parser_finds_nested_named_namespace() { std::shared_ptr client = parseCode( @@ -364,25 +880,13 @@ public: " {\n" " }\n" "}\n" - ); + ); TS_ASSERT_EQUALS(client->namespaces.size(), 2); TS_ASSERT_EQUALS(client->namespaces[0], "A <1:1 <1:11 1:11> 6:1>"); TS_ASSERT_EQUALS(client->namespaces[1], "A::B <3:2 <3:12 3:12> 5:2>"); } - void test_cxx_parser_finds_enum_defined_in_global_namespace() - { - std::shared_ptr client = parseCode( - "enum E\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->enums.size(), 1); - TS_ASSERT_EQUALS(client->enums[0], "E <1:1 <1:6 1:6> 3:1>"); - } - void test_cxx_parser_finds_enum_defined_in_class() { std::shared_ptr client = parseCode( @@ -393,7 +897,7 @@ public: " {\n" " };\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->enums.size(), 1); TS_ASSERT_EQUALS(client->enums[0], "public B::Z <4:2 <4:7 4:7> 6:2>"); @@ -408,1847 +912,12 @@ public: " {\n" " };\n" "}\n" - ); + ); TS_ASSERT_EQUALS(client->enums.size(), 1); TS_ASSERT_EQUALS(client->enums[0], "n::Z <3:2 <3:7 3:7> 5:2>"); } - void test_cxx_parser_finds_enum_constant_in_global_enum() - { - std::shared_ptr client = parseCode( - "enum E\n" - "{\n" - " P\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->enumConstants.size(), 1); - TS_ASSERT_EQUALS(client->enumConstants[0], "E::P <3:2 3:2>"); - } - - void test_cxx_parser_finds_typedef_in_global_namespace() - { - std::shared_ptr client = parseCode( - "typedef unsigned int uint;\n" - ); - - TS_ASSERT_EQUALS(client->typedefs.size(), 1); - TS_ASSERT_EQUALS(client->typedefs[0], "unsigned int -> uint <1:22 1:25>"); - } - - void test_cxx_parser_finds_typedef_in_named_namespace() - { - std::shared_ptr client = parseCode( - "namespace test\n" - "{\n" - " typedef unsigned int uint;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->typedefs.size(), 1); - TS_ASSERT_EQUALS(client->typedefs[0], "unsigned int -> test::uint <3:23 3:26>"); - } - - void test_cxx_parser_finds_typedef_in_anonymous_namespace() - { - std::shared_ptr client = parseCode( - "namespace\n" - "{\n" - " typedef unsigned int uint;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->typedefs.size(), 1); - TS_ASSERT_EQUALS(client->typedefs[0], "unsigned int -> anonymous namespace (input.cc)::uint <3:23 3:26>"); - } - - void test_cxx_parser_finds_typedef_that_uses_type_defined_in_named_namespace() - { - std::shared_ptr client = parseCode( - "namespace test\n" - "{\n" - " struct TestStruct{};\n" - "}\n" - "typedef test::TestStruct globalTestStruct;\n" - ); - - TS_ASSERT_EQUALS(client->typedefs.size(), 1); - TS_ASSERT_EQUALS(client->typedefs[0], "test::TestStruct -> globalTestStruct <5:26 5:41>"); - } - - void test_cxx_parser_finds_global_variable_with_typedef_type() - { - std::shared_ptr client = parseCode( - "typedef unsigned int uint;\n" - "uint number;\n" - ); - - TS_ASSERT_EQUALS(client->typedefs.size(), 1); - TS_ASSERT_EQUALS(client->typedefs[0], "unsigned int -> uint <1:22 1:25>"); - - TS_ASSERT_EQUALS(client->globalVariables.size(), 1); - TS_ASSERT_EQUALS(client->globalVariables[0], "uint number <2:6 2:11>"); - } - - void test_cxx_parser_finds_global_variable_with_qualified_typedef_type() - { - std::shared_ptr client = parseCode( - "typedef unsigned int* uint;\n" - "const uint* number;\n" - ); - - TS_ASSERT_EQUALS(client->typedefs.size(), 1); - TS_ASSERT_EQUALS(client->typedefs[0], "unsigned int * -> uint <1:23 1:26>"); - - TS_ASSERT_EQUALS(client->globalVariables.size(), 1); - TS_ASSERT_EQUALS(client->globalVariables[0], "uint const * number <2:13 2:18>"); - } - - void test_cxx_parser_finds_class_default_private_inheritance() - { - std::shared_ptr client = parseCode( - "class A {};\n" - "class B : A {};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 1); - TS_ASSERT_EQUALS(client->inheritances[0], "B : private A <2:11 2:11>"); - } - - void test_cxx_parser_finds_class_public_inheritance() - { - std::shared_ptr client = parseCode( - "class A {};\n" - "class B : public A {};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 1); - TS_ASSERT_EQUALS(client->inheritances[0], "B : public A <2:11 2:18>"); - } - - void test_cxx_parser_finds_class_protected_inheritance() - { - std::shared_ptr client = parseCode( - "class A {};\n" - "class B : protected A {};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 1); - TS_ASSERT_EQUALS(client->inheritances[0], "B : protected A <2:11 2:21>"); - } - - void test_cxx_parser_finds_class_private_inheritance() - { - std::shared_ptr client = parseCode( - "class A {};\n" - "class B : private A {};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 1); - TS_ASSERT_EQUALS(client->inheritances[0], "B : private A <2:11 2:19>"); - } - - void test_cxx_parser_finds_class_multiple_inheritance() - { - std::shared_ptr client = parseCode( - "class A {};\n" - "class B {};\n" - "class C\n" - " : public A\n" - " , private B\n" - "{};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 2); - TS_ASSERT_EQUALS(client->inheritances[0], "C : public A <4:4 4:11>"); - TS_ASSERT_EQUALS(client->inheritances[1], "C : private B <5:4 5:12>"); - } - - void test_cxx_parser_finds_struct_default_public_inheritance() - { - std::shared_ptr client = parseCode( - "struct A {};\n" - "struct B : A {};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 1); - TS_ASSERT_EQUALS(client->inheritances[0], "B : public A <2:12 2:12>"); - } - - void test_cxx_parser_finds_struct_public_inheritance() - { - std::shared_ptr client = parseCode( - "struct A {};\n" - "struct B : public A {};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 1); - TS_ASSERT_EQUALS(client->inheritances[0], "B : public A <2:12 2:19>"); - } - - void test_cxx_parser_finds_struct_protected_inheritance() - { - std::shared_ptr client = parseCode( - "struct A {};\n" - "struct B : protected A {};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 1); - TS_ASSERT_EQUALS(client->inheritances[0], "B : protected A <2:12 2:22>"); - } - - void test_cxx_parser_finds_struct_private_inheritance() - { - std::shared_ptr client = parseCode( - "struct A {};\n" - "struct B : private A {};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 1); - TS_ASSERT_EQUALS(client->inheritances[0], "B : private A <2:12 2:20>"); - } - - void test_cxx_parser_finds_struct_multiple_inheritance() - { - std::shared_ptr client = parseCode( - "struct A {};\n" - "struct B {};\n" - "struct C\n" - " : public A\n" - " , private B\n" - "{};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 2); - TS_ASSERT_EQUALS(client->inheritances[0], "C : public A <4:4 4:11>"); - TS_ASSERT_EQUALS(client->inheritances[1], "C : private B <5:4 5:12>"); - } - - void test_cxx_parser_finds_method_override_when_virtual() - { - std::shared_ptr client = parseCode( - "class A {\n" - " virtual void foo();\n" - "};\n" - "class B : public A {\n" - " void foo();\n" - "};" - ); - - TS_ASSERT_EQUALS(client->overrides.size(), 1); - TS_ASSERT_EQUALS(client->overrides[0], "void A::foo() -> void B::foo() <5:7 5:9>"); - } - - void test_cxx_parser_finds_no_method_override_when_not_virtual() - { - std::shared_ptr client = parseCode( - "class A {\n" - " void foo();\n" - "};\n" - "class B : public A {\n" - " void foo();\n" - "};" - ); - - TS_ASSERT_EQUALS(client->overrides.size(), 0); - } - - void test_cxx_parser_finds_all_method_overrides() - { - std::shared_ptr client = parseCode( - "class A {\n" - " virtual void foo();\n" - "};\n" - "class B : public A {\n" - " void foo();\n" - "};\n" - "class C : public B {\n" - " void foo();\n" - "};" - ); - - TS_ASSERT_EQUALS(client->overrides.size(), 2); - TS_ASSERT_EQUALS(client->overrides[0], "void A::foo() -> void B::foo() <5:7 5:9>"); - TS_ASSERT_EQUALS(client->overrides[1], "void B::foo() -> void C::foo() <8:7 8:9>"); - } - - void test_cxx_parser_finds_no_method_overrides_on_different_signatures() - { - std::shared_ptr client = parseCode( - "class A {\n" - " virtual void foo(int a);\n" - "};\n" - "class B : public A {\n" - " int foo(int a, int b);\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->overrides.size(), 0); - } - - void test_cxx_parser_finds_method_overrides_on_different_return_types() - { - std::shared_ptr client = parseCode( - "class A {\n" - " virtual void foo();\n" - "};\n" - "class B : public A {\n" - " int foo();\n" - "};\n", - false - ); - - TS_ASSERT_EQUALS(client->overrides.size(), 1); - TS_ASSERT_EQUALS(client->overrides[0], "void A::foo() -> int B::foo() <5:6 5:8>"); - TS_ASSERT_EQUALS(client->errors.size(), 1); - } - - void test_cxx_parser_finds_call_in_function() - { - std::shared_ptr client = parseCode( - "int sum(int a, int b)\n" - "{\n" - " return a + b;\n" - "}\n" - "int main()\n" - "{\n" - " sum(1, 2);\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 1); - TS_ASSERT_EQUALS(client->calls[0], "int main() -> int sum(int, int) <7:2 7:10>"); - } - - void test_cxx_parser_finds_call_in_function_with_right_signature() - { - std::shared_ptr client = parseCode( - "int sum(int a, int b)\n" - "{\n" - " return a + b;\n" - "}\n" - "void func()\n" - "{\n" - "}\n" - "void func(bool right)\n" - "{\n" - " sum(1, 2);\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 1); - TS_ASSERT_EQUALS(client->calls[0], "void func(bool) -> int sum(int, int) <10:2 10:10>"); - } - - void test_cxx_parser_finds_call_to_function_with_right_signature() - { - std::shared_ptr client = parseCode( - "int sum(int a, int b)\n" - "{\n" - " return a + b;\n" - "}\n" - "float sum(float a, float b)\n" - "{\n" - " return a + b;\n" - "}\n" - "int main()\n" - "{\n" - " sum(1, 2);\n" - " sum(1.0f, 0.5f);\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 2); - TS_ASSERT_EQUALS(client->calls[0], "int main() -> int sum(int, int) <11:2 11:10>"); - TS_ASSERT_EQUALS(client->calls[1], "int main() -> float sum(float, float) <12:2 12:16>"); - } - - void test_cxx_parser_finds_call_within_call_in_function() - { - std::shared_ptr client = parseCode( - "int sum(int a, int b)\n" - "{\n" - " return a + b;\n" - "}\n" - "int main()\n" - "{\n" - " return sum(1, sum(2, 3));\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 2); - TS_ASSERT_EQUALS(client->calls[0], "int main() -> int sum(int, int) <7:9 7:25>"); - TS_ASSERT_EQUALS(client->calls[1], "int main() -> int sum(int, int) <7:16 7:24>"); - } - - void test_cxx_parser_finds_call_in_method() - { - std::shared_ptr client = parseCode( - "int sum(int a, int b)\n" - "{\n" - " return a + b;\n" - "}\n" - "class App\n" - "{\n" - " int main()\n" - " {\n" - " return sum(1, 2);\n" - " }\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 1); - TS_ASSERT_EQUALS(client->calls[0], "int App::main() -> int sum(int, int) <9:10 9:18>"); - } - - void test_cxx_parser_finds_constructor_call() - { - std::shared_ptr client = parseCode( - "class App\n" - "{\n" - "public:\n" - " App() {}\n" - "};\n" - "int main()\n" - "{\n" - " App app;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 1); - TS_ASSERT_EQUALS(client->calls[0], "int main() -> void App::App() <8:6 8:8>"); - } - - void test_cxx_parser_finds_constructor_without_definition_call() - { - std::shared_ptr client = parseCode( - "class App\n" - "{\n" - "};\n" - "int main()\n" - "{\n" - " App app;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 1); - TS_ASSERT_EQUALS(client->calls[0], "int main() -> void App::App() <6:6 6:8>"); - } - - void test_cxx_parser_finds_constructor_call_of_field() - { - std::shared_ptr client = parseCode( - "class Item\n" - "{\n" - "};\n" - "class App\n" - "{\n" - "public:\n" - " App() {}\n" - " Item item;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 1); - TS_ASSERT_EQUALS(client->calls[0], "void App::App() -> void Item::Item() <7:2 7:4>"); - } - - void test_cxx_parser_finds_constructor_call_of_field_in_initialization_list() - { - std::shared_ptr client = parseCode( - "class Item\n" - "{\n" - "public:\n" - " Item(int n) {}\n" - "};\n" - "class App\n" - "{\n" - " App()\n" - " : item(1)" - " {}\n" - " Item item;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 1); - TS_ASSERT_EQUALS(client->calls[0], "void App::App() -> void Item::Item(int) <9:5 9:11>"); - } - - void test_cxx_parser_finds_function_call_as_parameter_of_constructor_call_of_field_in_initialization_list() - { - std::shared_ptr client = parseCode( - "int one() { return 1; }\n" - "class Item\n" - "{\n" - "public:\n" - " Item(int n) {}\n" - "};\n" - "class App\n" - "{\n" - " App()\n" - " : item(one())" - " {}\n" - " Item item;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 2); - TS_ASSERT_EQUALS(client->calls[0], "void App::App() -> void Item::Item(int) <10:5 10:15>"); - TS_ASSERT_EQUALS(client->calls[1], "void App::App() -> int one() <10:10 10:14>"); - } - - void test_cxx_parser_finds_copy_constructor_call() - { - std::shared_ptr client = parseCode( - "class App\n" - "{\n" - "public:\n" - " App() {}\n" - " App(const App& other) {}\n" - "};\n" - "int main()\n" - "{\n" - " App app;\n" - " App app2(app);\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 2); - TS_ASSERT_EQUALS(client->calls[0], "int main() -> void App::App() <9:6 9:8>"); - TS_ASSERT_EQUALS(client->calls[1], "int main() -> void App::App(App const &) <10:6 10:14>"); - } - - void test_cxx_parser_finds_global_constructor_call() - { - std::shared_ptr client = parseCode( - "class App\n" - "{\n" - "public:\n" - " App() {}\n" - "};\n" - "App app;\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 1); - TS_ASSERT_EQUALS(client->calls[0], "app -> void App::App() <6:5 6:7>"); - } - - void test_cxx_parser_finds_global_function_call() - { - std::shared_ptr client = parseCode( - "int one() { return 1; }\n" - "int a = one();\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 1); - TS_ASSERT_EQUALS(client->calls[0], "a -> int one() <2:9 2:13>"); - } - - void test_cxx_parser_finds_operator_call() - { - std::shared_ptr client = parseCode( - "class App\n" - "{\n" - "public:\n" - " void operator+(int a)\n" - " {\n" - " }\n" - "};\n" - "int main()\n" - "{\n" - " App app;\n" - " app + 2;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->calls.size(), 2); - TS_ASSERT_EQUALS(client->calls[0], "int main() -> void App::App() <10:6 10:8>"); - TS_ASSERT_EQUALS(client->calls[1], "int main() -> void App::operator+(int) <11:2 11:8>"); - } - - void test_cxx_parser_finds_usage_of_global_variable_in_function() - { - std::shared_ptr client = parseCode( - "int bar;\n" - "\n" - "int main()\n" - "{\n" - " bar = 1;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->usages.size(), 1); - TS_ASSERT_EQUALS(client->usages[0], "int main() -> bar <5:2 5:4>"); - } - - void test_cxx_parser_finds_usage_of_global_variable_in_global_variable_initialization() - { - std::shared_ptr client = parseCode( - "int a = 0;\n" - "int b[] = {a};\n" - ); - - TS_ASSERT_EQUALS(client->usages.size(), 1); - TS_ASSERT_EQUALS(client->usages[0], "int [] b -> a <2:12 2:12>"); - } - - void test_cxx_parser_finds_usage_of_global_variable_in_method() - { - std::shared_ptr client = parseCode( - "int bar;\n" - "\n" - "class App\n" - "{\n" - " void foo()\n" - " {\n" - " bar = 1;\n" - " }\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->usages.size(), 1); - TS_ASSERT_EQUALS(client->usages[0], "void App::foo() -> bar <7:3 7:5>"); - } - - void test_cxx_parser_finds_usage_of_field_in_method() - { - std::shared_ptr client = parseCode( - "class App\n" - "{\n" - " void foo()\n" - " {\n" - " bar = 1;\n" - " this->bar = 2;\n" - " }\n" - " int bar;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->usages.size(), 2); - TS_ASSERT_EQUALS(client->usages[0], "void App::foo() -> App::bar <5:3 5:5>"); - TS_ASSERT_EQUALS(client->usages[1], "void App::foo() -> App::bar <6:3 6:11>"); - } - - void test_cxx_parser_finds_usage_of_field_in_initialization_list() - { - std::shared_ptr client = parseCode( - "class App\n" - "{\n" - " App()\n" - " : bar(42)\n" - " {}\n" - " int bar;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->usages.size(), 1); - TS_ASSERT_EQUALS(client->usages[0], "void App::App() -> App::bar <4:5 4:7>"); - } - - void test_cxx_parser_finds_return_type_use_in_function() - { - std::shared_ptr client = parseCode( - "double PI()\n" - "{\n" - " return 3.14159265359;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->typeUses.size(), 1); - TS_ASSERT_EQUALS(client->typeUses[0], "double <1:1 1:6>"); - } - - void test_cxx_parser_finds_return_and_parameter_type_uses_in_function() - { - std::shared_ptr client = parseCode( - "int ceil(float a)\n" - "{\n" - " return static_cast(a) + 1;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->typeUses.size(), 2); - TS_ASSERT_EQUALS(client->typeUses[0], "int <1:1 1:3>"); - TS_ASSERT_EQUALS(client->typeUses[1], "float <1:10 1:14>"); - } - - void test_cxx_parser_finds_parameter_type_uses_in_constructor() - { - std::shared_ptr client = parseCode( - "class A\n" - "{\n" - " A(int a, bool b, float c, int d);\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->typeUses.size(), 4); - TS_ASSERT_EQUALS(client->typeUses[0], "int <3:4 3:6>"); - TS_ASSERT_EQUALS(client->typeUses[1], "bool <3:11 3:14>"); - TS_ASSERT_EQUALS(client->typeUses[2], "float <3:19 3:23>"); - TS_ASSERT_EQUALS(client->typeUses[3], "int <3:28 3:30>"); - } - - void test_cxx_parser_finds_type_uses_in_function_body() - { - std::shared_ptr client = parseCode( - "int main()\n" - "{\n" - " int a = 42;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->typeUses.size(), 2); - TS_ASSERT_EQUALS(client->typeUses[0], "int <1:1 1:3>"); - TS_ASSERT_EQUALS(client->typeUses[1], "int main() -> int <3:2 3:4>"); - } - - void test_cxx_parser_finds_type_uses_in_method_body() - { - std::shared_ptr client = parseCode( - "class A\n" - "{\n" - " int main()\n" - " {\n" - " int a = 42;\n" - " return a;\n" - " }\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->typeUses.size(), 2); - TS_ASSERT_EQUALS(client->typeUses[0], "int <3:2 3:4>"); - TS_ASSERT_EQUALS(client->typeUses[1], "int A::main() -> int <5:3 5:5>"); - } - - void test_cxx_parser_finds_type_uses_in_loops_and_conditions() - { - std::shared_ptr client = parseCode( - "int main()\n" - "{\n" - " if (true)\n" - " {\n" - " int a = 42;\n" - " }\n" - " for (int i = 0; i < 10; i++)\n" - " {\n" - " int b = i * 2;\n" - " }\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->typeUses.size(), 4); - TS_ASSERT_EQUALS(client->typeUses[0], "int <1:1 1:3>"); - TS_ASSERT_EQUALS(client->typeUses[1], "int main() -> int <5:3 5:5>"); - TS_ASSERT_EQUALS(client->typeUses[2], "int main() -> int <7:7 7:9>"); - TS_ASSERT_EQUALS(client->typeUses[3], "int main() -> int <9:3 9:5>"); - } - - void test_cxx_parser_finds_type_uses_of_classes_in_functions() - { - std::shared_ptr client = parseCode( - "class A {};\n" - "int main()\n" - "{\n" - " A a;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->typeUses.size(), 2); - TS_ASSERT_EQUALS(client->typeUses[0], "int <2:1 2:3>"); - TS_ASSERT_EQUALS(client->typeUses[1], "int main() -> A <4:2 4:2>"); - } - - void test_cxx_parser_finds_type_uses_of_base_class_in_derived_constructor() - { - std::shared_ptr client = parseCode( - "class A\n" - "{\n" - "public:\n" - " A(int n) {}" - "};\n" - "class B : public A\n" - "{\n" - "public:\n" - " B() : A(42) {}\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->typeUses.size(), 2); - TS_ASSERT_EQUALS(client->typeUses[0], "int <4:4 4:6>"); - TS_ASSERT_EQUALS(client->typeUses[1], "void B::B() -> A <8:8 8:8>"); - } - - void test_cxx_parser_finds_enum_uses_in_global_space() - { - std::shared_ptr client = parseCode( - "enum A\n" - "{\n" - " B,\n" - " C\n" - "};\n" - "A a = B;\n" - "A* aPtr = new A;\n" - ); - - TS_ASSERT_EQUALS(client->usages.size(), 1); - TS_ASSERT_EQUALS(client->usages[0], "A a -> A::B <6:7 6:7>"); - TS_ASSERT_EQUALS(client->typeUses.size(), 1); - TS_ASSERT_EQUALS(client->typeUses[0], "A <7:15 7:15>"); - TS_ASSERT_EQUALS(client->globalVariables.size(), 2); - TS_ASSERT_EQUALS(client->globalVariables[0], "A a <6:3 6:3>"); - TS_ASSERT_EQUALS(client->globalVariables[1], "A * aPtr <7:4 7:7>"); - } - - void test_cxx_parser_finds_enum_uses_in_function_body() - { - std::shared_ptr client = parseCode( - "enum A\n" - "{\n" - " B,\n" - " C\n" - "};\n" - "int main()\n" - "{\n" - " A a = B;\n" - " A* aPtr = new A;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->usages.size(), 1); - TS_ASSERT_EQUALS(client->usages[0], "int main() -> A::B <8:8 8:8>"); - TS_ASSERT_EQUALS(client->typeUses.size(), 4); - TS_ASSERT_EQUALS(client->typeUses[0], "int <6:1 6:3>"); - TS_ASSERT_EQUALS(client->typeUses[1], "int main() -> A <8:2 8:2>"); - TS_ASSERT_EQUALS(client->typeUses[2], "int main() -> A * <9:2 9:3>"); - TS_ASSERT_EQUALS(client->typeUses[3], "int main() -> A <9:16 9:16>"); - } - - void test_cxx_parser_finds_macro_define() - { - std::shared_ptr client = parseCode( - "#define PI\n" - "void test()\n" - "{\n" - "};\n" - ); - TS_ASSERT_EQUALS(client->macros.size(),1); - TS_ASSERT_EQUALS(client->macros[0], "PI <1:9 <1:9 1:10> 1:8>"); - } - - void test_cxx_parser_finds_macro_define_scope() - { - std::shared_ptr client = parseCode( - "#define MAX(a,b) \\\n" - " ((a)>(b)?(a):(b))" - ); - TS_ASSERT_EQUALS(client->macros.size(),1); - TS_ASSERT_EQUALS(client->macros[0], "MAX <1:9 <1:9 1:11> 2:17>"); - } - - void test_cxx_parser_finds_macro_expand() - { - std::shared_ptr client = parseCode( - "#define PI 3.14159265359\n" - "void test()\n" - "{\n" - "double i = PI;" - "};\n" - ); - TS_ASSERT_EQUALS(client->macroUses.size(),1); - TS_ASSERT_EQUALS(client->macroUses[0], "PI <4:12 4:13>"); - } - - void test_cxx_parser_finds_type_template_parameter_type_of_template_class() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:20 1:20>"); - } - - void test_cxx_parser_finds_type_template_parameter_defined_with_class_keyword() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:17 1:17>"); - } - - void test_cxx_parser_finds_type_template_parameter_pack_type_of_template_class() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:23 1:23>"); - } - - void test_cxx_parser_finds_non_type_int_template_parameter_of_template_class() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:15 1:15>"); - } - - void test_cxx_parser_finds_non_type_bool_template_parameter_of_template_class() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:16 1:16>"); - } - - void test_cxx_parser_finds_non_type_custom_pointer_template_parameter_of_template_class() - { - std::shared_ptr client = parseCode( - "class P\n" - "{};\n" - "template \n" - "class A\n" - "{};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A

::p <3:14 3:14>"); - } - - void test_cxx_parser_finds_non_type_custom_reference_template_parameter_of_template_class() - { - std::shared_ptr client = parseCode( - "class P\n" - "{};\n" - "template \n" - "class A\n" - "{};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A

::p <3:14 3:14>"); - } - - void test_cxx_parser_finds_non_type_nullptr_template_parameter_of_template_class() - { - std::shared_ptr client = parseCode( - "#include \n" - "template \n" - "class A\n" - "{};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <2:26 2:26>"); - } - - void test_cxx_parser_finds_non_type_template_parameter_that_depends_on_type_template_parameter_of_template_class() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T1 <1:20 1:21>"); - TS_ASSERT_EQUALS(client->templateParameterTypes[1], "A::T2 <1:28 1:29>"); - } - - void test_cxx_parser_finds_non_type_template_parameter_that_depends_on_template_template_parameter_of_template_class() - { - std::shared_ptr client = parseCode( - "template class T1, T1& T2>\n" - "class A\n" - "{};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A typename T1, T1 & T2>::T1 <1:36 1:37>"); - TS_ASSERT_EQUALS(client->templateParameterTypes[1], "A typename T1, T1 & T2>::T2 <1:49 1:50>"); - } - - void test_cxx_parser_finds_non_type_int_template_parameter_pack_type_of_template_class() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:18 1:18>"); - } - - void test_cxx_parser_finds_template_template_parameter_of_template_class() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{};\n" - "template class T>\n" - "class B\n" - "{};\n" - "int main()\n" - "{\n" - " B ba;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:20 1:20>"); - TS_ASSERT_EQUALS(client->templateParameterTypes[1], "B typename T>::T <4:36 4:36>"); - } - - void test_cxx_parser_finds_template_template_parameter_pack_type_of_template_class() - { - std::shared_ptr client = parseCode( - "template typename... T>\n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A typename... T>::T <1:42 1:42>"); - } - - void test_cxx_parser_finds_usage_of_template_template_parameter_of_template_class_specialized_with_concrete_type() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{};\n" - "template class T>\n" - "class B\n" - "{\n" - " void foo(T parameter)\n" - " {}\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->typeUses.size(), 2); - TS_ASSERT_EQUALS(client->typeUses[0], "void <7:2 7:5>"); - TS_ASSERT_EQUALS(client->typeUses[1], "B typename T>::T <7:11 7:16>"); - } - - void test_cxx_parser_finds_usage_of_template_template_parameter_of_template_class_specialized_with_template_type() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{};\n" - "template class T>\n" - "class B\n" - "{\n" - " template \n" - " void foo(T parameter)\n" - " {}\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->typeUses.size(), 2); - TS_ASSERT_EQUALS(client->typeUses[0], "void <8:2 8:5>"); - TS_ASSERT_EQUALS(client->typeUses[1], "B typename T>::T typename T>::foo::U> <8:11 8:14>"); - } - - void test_cxx_parser_finds_typedef_in_other_class_that_depends_on_own_template_parameter() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "public:" - " typedef T type;\n" - "};\n" - "template \n" - "class B\n" - "{\n" - "public:" - " typedef typename A::type type;\n" - "};\n" - - "B::type f = 0;\n" - - ); - TS_ASSERT_EQUALS(client->typedefs.size(), 2); - TS_ASSERT_EQUALS(client->typedefs[0], "public A::T -> A::type <4:19 4:22>"); - TS_ASSERT_EQUALS(client->typedefs[1], "public A::U>::type -> B::type <9:37 9:40>"); - } - - void test_cxx_parser_finds_type_template_parameters_of_template_class_with_multiple_parameters() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:20 1:20>"); - TS_ASSERT_EQUALS(client->templateParameterTypes[1], "A::U <1:32 1:32>"); - } - - void test_cxx_parser_skips_creating_node_for_template_parameter_without_a_name() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->classes.size(), 1); - TS_ASSERT_EQUALS(client->classes[0], "A <1:1 <2:7 2:7> 4:1>"); - } - - void test_cxx_parser_finds_type_template_parameter_of_template_method_definition_outside_template_class() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - " template \n" - " U foo();\n" - "};\n" - "template \n" - "template \n" - "U A::foo()\n" - "{}\n" - ); - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 3); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:20 1:20>"); - TS_ASSERT_EQUALS(client->templateParameterTypes[1], "A::foo::U <4:21 4:21>"); - TS_ASSERT_EQUALS(client->templateParameterTypes[2], "A::foo::U <8:20 8:20>"); - } - - void test_cxx_parser_finds_type_template_argument_of_implicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "int main()\n" - "{\n" - " A a;\n" - " return 0;\n" - "}\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->int <7:4 7:6>"); - } - void test_cxx_parser_finds_type_template_argument_for_parameter_pack_of_implicit_template_specialization() // actually this is an explicit template instantiation - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "int main()\n" - "{\n" - " A();\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<>->int <7:6 7:8>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<>->float <7:11 7:15>"); - } - - void test_cxx_parser_finds_type_template_argument_for_parameter_of_implicit_template_s______tion_of_non_default_constructor() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "public:\n" - " A(int data){}\n" - "};\n" - "int main()\n" - "{\n" - " A(5);\n" - "}\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->int <9:4 9:6>"); - } - - void test_cxx_parser_finds_type_template_argument_for_parameter_of_implicit_template_s___kk_tion_of_call_to_default_constructor() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "public:\n" - " A(){}\n" - "};\n" - "int main()\n" - "{\n" - " A();\n" - "}\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->int <9:4 9:6>"); - } - - void test_cxx_parser_finds_type_template_argument_for_parameter_of_implicit_temple_of_new_expression() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "public:\n" - " A(){}\n" - "};\n" - "int main()\n" - "{\n" - " new A();\n" - "}\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->int <9:8 9:10>"); - } - - void test_cxx_parser_finds_non_type_int_template_argument_of_implicit_template_instantiation() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "int main()\n" - "{\n" - " A<1> a;\n" - " return 0;\n" - "}\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<1>->int <7:4 7:4>"); - } - - //void _____test_cxx_parser_finds_type_template_argument_of_static_cast_expression() - //{ - // std::shared_ptr client = parseCode( - // "int main()\n" - // "{\n" - // " return static_cast(4.0f);" - // "}\n" - // ); - // TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - // TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<1>->int <0:0 0:0>"); - //} - - - - void test_cxx_parser_finds_non_type_bool_template_argument_of_implicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "int main()\n" - "{\n" - " A a;\n" - " return 0;\n" - "}\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->bool <7:4 7:7>"); - } - - void test_cxx_parser_finds_non_type_custom_pointer_template_argument_of_implicit_template_specialization() - { - std::shared_ptr client = parseCode( - "class P\n" - "{};\n" - "template \n" - "class A\n" - "{};\n" - "P p;\n" - "int main()\n" - "{\n" - " A<&p> a;\n" - "}\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&p>->P <9:4 9:5>"); - } - - void test_cxx_parser_finds_non_type_custom_reference_template_argument_of_implicit_template_specialization() - { - std::shared_ptr client = parseCode( - "class P\n" - "{};\n" - "template \n" - "class A\n" - "{};\n" - "P p;\n" - "int main()\n" - "{\n" - " A

a;\n" - "}\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&p>->P <9:4 9:4>"); - } - - void test_cxx_parser_finds_non_type_nullptr_template_argument_of_implicit_template_specialization() - { - std::shared_ptr client = parseCode( - "#include \n" - "template \n" - "class A\n" - "{};\n" - "int main()\n" - "{\n" - " A a;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->nullptr_t <7:4 7:10>"); - } - - void test_cxx_parser_finds_non_type_int_template_argument_for_parameter_pack_of_implicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "int main()\n" - "{\n" - " A<1, 2, 33>();\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 3); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<<1, 2, 33>>->int <7:6 7:6>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<<1, 2, 33>>->int <7:9 7:9>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[2], "A<<1, 2, 33>>->int <7:12 7:13>"); - } - - void test_cxx_parser_finds_template_template_argument_of_implicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{};\n" - "template class T>\n" - "class B\n" - "{};\n" - "int main()\n" - "{\n" - " B ba;\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "B->A <9:4 9:4>"); - } - - void test_cxx_parser_finds_template_template_argument_for_parameter_pack_of_implicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template typename... T>\n" - "class B\n" - "{\n" - "};\n" - "int main()\n" - "{\n" - " B();\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "B<>->A <11:4 11:4>"); - } - - void test_cxx_parser_finds_template_member_specialization_of_implicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "public:\n" - " T foo() {}\n" - "};\n" - "int main()\n" - "{\n" - " A a;\n" - "}\n" - ); - TS_ASSERT_EQUALS(client->templateMemberSpecializations.size(), 1); - TS_ASSERT_EQUALS(client->templateMemberSpecializations[0], "int A::foo() -> A::T A::foo() <0:0 0:0>"); - } - - void test_cxx_parser_finds_explicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template <>\n" - "class A\n" - "{\n" - "};\n" - ); - TS_ASSERT_EQUALS(client->templateSpecializations.size(), 1); - TS_ASSERT_EQUALS(client->templateSpecializations[0], "class A -> A <6:7 6:7>"); - } - - void test_cxx_parser_finds_type_template_argument_of_explicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template <>\n" - "class A\n" - "{\n" - "};\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->int <6:9 6:11>"); - } - - void test_cxx_parser_finds_non_type_int_template_argument_of_explicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template <>\n" - "class A<1>\n" - "{\n" - "};\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<1>->int <6:9 6:9>"); - } - - void test_cxx_parser_finds_non_type_bool_template_argument_of_explicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template <>\n" - "class A\n" - "{\n" - "};\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->bool <6:9 6:12>"); - } - - void test_cxx_parser_finds_non_type_custom_pointer_template_argument_of_explicit_template_specialization() - { - std::shared_ptr client = parseCode( - "class P\n" - "{};\n" - "template \n" - "class A\n" - "{};\n" - "P p;\n" - "template <>\n" - "class A<&p>\n" - "{\n" - "};\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&p>->P <8:9 8:10>"); - } - - void test_cxx_parser_finds_non_type_custom_reference_template_argument_of_explicit_template_specialization() - { - std::shared_ptr client = parseCode( - "class P\n" - "{};\n" - "template \n" - "class A\n" - "{};\n" - "P p;\n" - "template <>\n" - "class A

\n" - "{\n" - "};\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&p>->P <8:9 8:9>"); - } - - void test_cxx_parser_finds_non_type_nullptr_template_argument_of_explicit_template_specialization() - { - std::shared_ptr client = parseCode( - "#include \n" - "template \n" - "class A\n" - "{};\n" - "template <>\n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->nullptr_t <6:9 6:15>"); - } - - void test_cxx_parser_finds_template_template_argument_of_explicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{};\n" - "template class T>\n" - "class B\n" - "{};\n" - "template <>\n" - "class B\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "B->A <8:9 8:9>"); - } - - void test_cxx_parser_finds_explicit_partial_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template \n" - "class A\n" - "{\n" - "};\n" - ); - TS_ASSERT_EQUALS(client->templateSpecializations.size(), 1); - TS_ASSERT_EQUALS(client->templateSpecializations[0], "class A -> A <6:7 6:7>"); - } - - void test_cxx_parser_finds_type_template_argument_of_explicit_partial_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template \n" - "class A\n" - "{\n" - "};\n" - ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->A::T <6:9 6:9>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A->int <6:12 6:14>"); - } - - void test_cxx_parser_finds_non_type_int_template_argument_of_explicit_partial_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template \n" - "class A<3, U>\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<3, int U>->int <6:9 6:9>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<3, int U>->int <6:12 6:12>"); - } - - void test_cxx_parser_finds_non_type_bool_template_argument_of_explicit_partial_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->bool <6:9 6:12>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A->bool <6:15 6:15>"); - } - - void test_cxx_parser_finds_non_type_custom_pointer_template_argument_of_explicit_partial_template_specialization() - { - std::shared_ptr client = parseCode( - "class P\n" - "{};\n" - "template \n" - "class A\n" - "{};\n" - "P p;\n" - "template \n" - "class A<&p, q>\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&p, P * q>->P <8:9 8:10>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<&p, P * q>->P <8:13 8:13>"); - } - - void test_cxx_parser_finds_non_type_custom_reference_template_argument_of_explicit_partial_template_specialization() - { - std::shared_ptr client = parseCode( - "class P\n" - "{};\n" - "template \n" - "class A\n" - "{};\n" - "P p;\n" - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&p, P & q>->P <8:9 8:9>"); // why reference here? - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<&p, P & q>->P <8:12 8:12>"); - } - - void test_cxx_parser_finds_non_type_nullptr_template_argument_of_explicit_partial_template_specialization() - { - std::shared_ptr client = parseCode( - "#include \n" - "template \n" - "class A\n" - "{};\n" - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->nullptr_t <6:9 6:15>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A->std::nullptr_t <6:18 6:18>"); - } - - void test_cxx_parser_finds_template_template_argument_of_explicit_partial_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{};\n" - "template class T, template class U>\n" - "class B\n" - "{};\n" - "template class U>\n" - "class B\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "B typename U>->A <8:9 8:9>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "B typename U>->B typename U>::U <8:12 8:12>"); - } - - - void test_cxx_parser_finds_non_type_template_argument_that_depends_on_type_template_parameter_of_explicit_partial_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template \n" - "class A<3, T2, T3>\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 3); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<3, typename T2, T2 T3>->int <6:9 6:9>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<3, typename T2, T2 T3>->A<3, typename T2, T2 T3>::T2 <6:12 6:13>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[2], "A<3, typename T2, T2 T3>->A<3, typename T2, T2 T3>::T2 <6:16 6:17>"); - } - - void test_cxx_parser_finds_non_type_template_argument_that_depends_on_template_template_parameter_of_explicit_partial_template_specialization() - { - std::shared_ptr client = parseCode( - "template class T2, T2 T3>\n" - "class A\n" - "{\n" - "};\n" - "template class T2, T2 T3>\n" - "class A<3, T2, T3>\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 3); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<3, template typename T2, T2 T3>->int <6:9 6:9>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<3, template typename T2, T2 T3>->A<3, template typename T2, T2 T3>::T2 <6:12 6:13>"); - TS_ASSERT_EQUALS(client->templateArgumentTypes[2], "A<3, template typename T2, T2 T3>->A<3, template typename T2, T2 T3>::T2 <6:16 6:17>"); - } - - void test_cxx_parser_finds_correct_name_of_explicit_template_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - "};\n" - "template \n" - "class A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->classes.size(), 2); - TS_ASSERT_EQUALS(client->classes[0], "A <1:1 <2:7 2:7> 4:1>"); - TS_ASSERT_EQUALS(client->classes[1], "A <5:1 <6:7 6:7> 8:1>"); - } - - void test_cxx_parser_finds_correct_field_member_name_of_template_class_in_declaration() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - " int foo;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->fields.size(), 1); - TS_ASSERT_EQUALS(client->fields[0], "private int A::foo <4:6 4:8>"); - } - - void test_cxx_parser_finds_correct_type_of_field_member_of_template_class_in_declaration() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - " T foo;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->fields.size(), 1); - TS_ASSERT_EQUALS(client->fields[0], "private A::T A::foo <4:4 4:6>"); - } - - void test_cxx_parser_finds_implicit_template_class_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - " T foo;\n" - "};\n" - "\n" - "A a;\n" - ); - - TS_ASSERT_EQUALS(client->templateSpecializations.size(), 1); - TS_ASSERT_EQUALS(client->templateSpecializations[0], "class A -> A <7:8 7:8>"); - } - - void test_cxx_parser_finds_class_inheritance_from_implicit_template_class_specialization() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - " T foo;\n" - "};\n" - "\n" - "class B: public A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 1); - TS_ASSERT_EQUALS(client->inheritances[0], "B : public A <7:10 7:22>"); - } - - void test_cxx_parser_finds_template_class_specialization_with_template_argument() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - " T foo;\n" - "};\n" - "\n" - "template \n" - "class B: public A\n" - "{\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->inheritances.size(), 1); - TS_ASSERT_EQUALS(client->inheritances[0], "B : public A::U> <8:10 8:20>"); - } - - void test_cxx_parser_finds_template_class_constructor_usage_of_field() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - " A(): foo() {}\n" - " T foo;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->usages.size(), 1); - TS_ASSERT_EQUALS(client->usages[0], "void A::A() -> A::foo <4:7 4:9>"); - } - void test_cxx_parser_finds_enum_definition_in_template_class() { std::shared_ptr client = parseCode( @@ -2261,7 +930,7 @@ public: " TEST_TWO\n" " };\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->enums.size(), 1); TS_ASSERT_EQUALS(client->enums[0], "private A::TestType <4:2 <4:7 4:14> 8:2>"); @@ -2280,10 +949,10 @@ public: " };\n" " TestType foo;\n" "};\n" - ); + ); - TS_ASSERT_EQUALS(client->fields.size(), 1); - TS_ASSERT_EQUALS(client->fields[0], "private A::TestType A::foo <9:11 9:13>"); + TS_ASSERT_EQUALS(client->typeUses.size(), 1); + TS_ASSERT_EQUALS(client->typeUses[0], "A::foo -> A::TestType <9:2 9:9>"); } void test_cxx_parser_finds_enum_constants_in_template_class() @@ -2298,25 +967,11 @@ public: " TEST_TWO\n" " };\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->enumConstants.size(), 2); - TS_ASSERT_EQUALS(client->enumConstants[0], "A::TestType::TEST_ONE <6:3 6:3>"); - TS_ASSERT_EQUALS(client->enumConstants[1], "A::TestType::TEST_TWO <7:3 7:3>"); - } - - void test_cxx_parser_finds_correct_field_member_type_of_nested_template_class_in_declaration_____typedef() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{\n" - " typedef T TempType;" - "};\n" - ); - - TS_ASSERT_EQUALS(client->typedefs.size(), 1); - TS_ASSERT_EQUALS(client->typedefs[0], "private A::T -> A::TempType <4:12 4:19>"); + TS_ASSERT_EQUALS(client->enumConstants[0], "A::TestType::TEST_ONE <6:3 6:10>"); + TS_ASSERT_EQUALS(client->enumConstants[1], "A::TestType::TEST_TWO <7:3 7:10>"); } void test_cxx_parser_finds_correct_field_member_type_of_nested_template_class_in_declaration() @@ -2330,24 +985,1376 @@ public: " T foo;\n" " };\n" "};\n" - ); + ); - TS_ASSERT_EQUALS(client->fields.size(), 1); - TS_ASSERT_EQUALS(client->fields[0], "private A::T A::B::foo <6:5 6:7>"); + TS_ASSERT_EQUALS(client->typeUses.size(), 1); + TS_ASSERT_EQUALS(client->typeUses[0], "A::B::foo -> A::T <6:3 6:3>"); } - void test_cxx_parser_finds_correct_method_member_name_of_template_class_in_declaration() + + + +/////////////////////////////////////////////////////////////////////////////// +// test finding usages of symbols + + void test_cxx_parser_finds_type_usage_of_global_variable() + { + std::shared_ptr client = parseCode( + "int x;\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 1); + TS_ASSERT_EQUALS(client->typeUses[0], "x -> int <1:1 1:3>"); + } + + void test_cxx_parser_finds_typedefs_type_use() + { + std::shared_ptr client = parseCode( + "typedef unsigned int uint;\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 1); + TS_ASSERT_EQUALS(client->typeUses[0], "uint -> unsigned int <1:9 1:16>"); + } + + void test_cxx_parser_finds_typedef_that_uses_type_defined_in_named_namespace() + { + std::shared_ptr client = parseCode( + "namespace test\n" + "{\n" + " struct TestStruct{};\n" + "}\n" + "typedef test::TestStruct globalTestStruct;\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 1); + TS_ASSERT_EQUALS(client->typeUses[0], "globalTestStruct -> test::TestStruct <5:15 5:24>"); + } + + void test_cxx_parser_finds_type_use_of_typedef() + { + std::shared_ptr client = parseCode( + "typedef unsigned int uint;\n" + "uint number;\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 2); + TS_ASSERT_EQUALS(client->typeUses[1], "number -> uint <2:1 2:4>"); + } + + void test_cxx_parser_finds_class_default_private_inheritance() + { + std::shared_ptr client = parseCode( + "class A {};\n" + "class B : A {};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 1); + TS_ASSERT_EQUALS(client->inheritances[0], "B : private A <2:11 2:11>"); + } + + void test_cxx_parser_finds_class_public_inheritance() + { + std::shared_ptr client = parseCode( + "class A {};\n" + "class B : public A {};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 1); + TS_ASSERT_EQUALS(client->inheritances[0], "B : public A <2:18 2:18>"); + } + + void test_cxx_parser_finds_class_protected_inheritance() + { + std::shared_ptr client = parseCode( + "class A {};\n" + "class B : protected A {};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 1); + TS_ASSERT_EQUALS(client->inheritances[0], "B : protected A <2:21 2:21>"); + } + + void test_cxx_parser_finds_class_private_inheritance() + { + std::shared_ptr client = parseCode( + "class A {};\n" + "class B : private A {};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 1); + TS_ASSERT_EQUALS(client->inheritances[0], "B : private A <2:19 2:19>"); + } + + void test_cxx_parser_finds_class_multiple_inheritance() + { + std::shared_ptr client = parseCode( + "class A {};\n" + "class B {};\n" + "class C\n" + " : public A\n" + " , private B\n" + "{};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 2); + TS_ASSERT_EQUALS(client->inheritances[0], "C : public A <4:11 4:11>"); + TS_ASSERT_EQUALS(client->inheritances[1], "C : private B <5:12 5:12>"); + } + + void test_cxx_parser_finds_struct_default_public_inheritance() + { + std::shared_ptr client = parseCode( + "struct A {};\n" + "struct B : A {};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 1); + TS_ASSERT_EQUALS(client->inheritances[0], "B : public A <2:12 2:12>"); + } + + void test_cxx_parser_finds_struct_public_inheritance() + { + std::shared_ptr client = parseCode( + "struct A {};\n" + "struct B : public A {};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 1); + TS_ASSERT_EQUALS(client->inheritances[0], "B : public A <2:19 2:19>"); + } + + void test_cxx_parser_finds_struct_protected_inheritance() + { + std::shared_ptr client = parseCode( + "struct A {};\n" + "struct B : protected A {};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 1); + TS_ASSERT_EQUALS(client->inheritances[0], "B : protected A <2:22 2:22>"); + } + + void test_cxx_parser_finds_struct_private_inheritance() + { + std::shared_ptr client = parseCode( + "struct A {};\n" + "struct B : private A {};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 1); + TS_ASSERT_EQUALS(client->inheritances[0], "B : private A <2:20 2:20>"); + } + + void test_cxx_parser_finds_struct_multiple_inheritance() + { + std::shared_ptr client = parseCode( + "struct A {};\n" + "struct B {};\n" + "struct C\n" + " : public A\n" + " , private B\n" + "{};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 2); + TS_ASSERT_EQUALS(client->inheritances[0], "C : public A <4:11 4:11>"); + TS_ASSERT_EQUALS(client->inheritances[1], "C : private B <5:12 5:12>"); + } + + void test_cxx_parser_finds_method_override_when_virtual() + { + std::shared_ptr client = parseCode( + "class A {\n" + " virtual void foo();\n" + "};\n" + "class B : public A {\n" + " void foo();\n" + "};" + ); + + TS_ASSERT_EQUALS(client->overrides.size(), 1); + TS_ASSERT_EQUALS(client->overrides[0], "void A::foo() -> void B::foo() <5:7 5:9>"); + } + + void test_cxx_parser_finds_multi_layer_method_overrides() + { + std::shared_ptr client = parseCode( + "class A {\n" + " virtual void foo();\n" + "};\n" + "class B : public A {\n" + " void foo();\n" + "};\n" + "class C : public B {\n" + " void foo();\n" + "};" + ); + + TS_ASSERT_EQUALS(client->overrides.size(), 2); + TS_ASSERT_EQUALS(client->overrides[0], "void A::foo() -> void B::foo() <5:7 5:9>"); + TS_ASSERT_EQUALS(client->overrides[1], "void B::foo() -> void C::foo() <8:7 8:9>"); + } + + void test_cxx_parser_finds_method_overrides_on_different_return_types() + { + std::shared_ptr client = parseCode( + "class A {\n" + " virtual void foo();\n" + "};\n" + "class B : public A {\n" + " int foo();\n" + "};\n", + false + ); + + TS_ASSERT_EQUALS(client->overrides.size(), 1); + TS_ASSERT_EQUALS(client->overrides[0], "void A::foo() -> int B::foo() <5:6 5:8>"); + TS_ASSERT_EQUALS(client->errors.size(), 1); + } + + void test_cxx_parser_finds_no_method_override_when_not_virtual() + { + std::shared_ptr client = parseCode( + "class A {\n" + " void foo();\n" + "};\n" + "class B : public A {\n" + " void foo();\n" + "};" + ); + + TS_ASSERT_EQUALS(client->overrides.size(), 0); + } + + void test_cxx_parser_finds_no_method_overrides_on_different_signatures() + { + std::shared_ptr client = parseCode( + "class A {\n" + " virtual void foo(int a);\n" + "};\n" + "class B : public A {\n" + " int foo(int a, int b);\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->overrides.size(), 0); + } + + void test_cxx_parser_finds_call_in_function() + { + std::shared_ptr client = parseCode( + "int sum(int a, int b)\n" + "{\n" + " return a + b;\n" + "}\n" + "int main()\n" + "{\n" + " sum(1, 2);\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 1); + TS_ASSERT_EQUALS(client->calls[0], "int main() -> int sum(int, int) <7:2 7:4>"); + } + + void test_cxx_parser_finds_call_in_function_with_right_signature() + { + std::shared_ptr client = parseCode( + "int sum(int a, int b)\n" + "{\n" + " return a + b;\n" + "}\n" + "void func()\n" + "{\n" + "}\n" + "void func(bool right)\n" + "{\n" + " sum(1, 2);\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 1); + TS_ASSERT_EQUALS(client->calls[0], "void func(bool) -> int sum(int, int) <10:2 10:4>"); + } + + void test_cxx_parser_finds_call_to_function_with_right_signature() + { + std::shared_ptr client = parseCode( + "int sum(int a, int b)\n" + "{\n" + " return a + b;\n" + "}\n" + "float sum(float a, float b)\n" + "{\n" + " return a + b;\n" + "}\n" + "int main()\n" + "{\n" + " sum(1, 2);\n" + " sum(1.0f, 0.5f);\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 2); + TS_ASSERT_EQUALS(client->calls[0], "int main() -> int sum(int, int) <11:2 11:4>"); + TS_ASSERT_EQUALS(client->calls[1], "int main() -> float sum(float, float) <12:2 12:4>"); + } + + void test_cxx_parser_finds_function_call_in_function_parameter_list() + { + std::shared_ptr client = parseCode( + "int sum(int a, int b)\n" + "{\n" + " return a + b;\n" + "}\n" + "int main()\n" + "{\n" + " return sum(1, sum(2, 3));\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 2); + TS_ASSERT_EQUALS(client->calls[0], "int main() -> int sum(int, int) <7:9 7:11>"); + TS_ASSERT_EQUALS(client->calls[1], "int main() -> int sum(int, int) <7:16 7:18>"); + } + + void test_cxx_parser_finds_function_call_in_method() + { + std::shared_ptr client = parseCode( + "int sum(int a, int b)\n" + "{\n" + " return a + b;\n" + "}\n" + "class App\n" + "{\n" + " int main()\n" + " {\n" + " return sum(1, 2);\n" + " }\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 1); + TS_ASSERT_EQUALS(client->calls[0], "int App::main() -> int sum(int, int) <9:10 9:12>"); + } + + void test_cxx_parser_finds_implicit_constructor_without_definition_call() + { + std::shared_ptr client = parseCode( + "class App\n" + "{\n" + "};\n" + "int main()\n" + "{\n" + " App app;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 1); + TS_ASSERT_EQUALS(client->calls[0], "int main() -> void App::App() <6:6 6:8>"); + } + + void test_cxx_parser_finds_explicit_constructor_call() + { + std::shared_ptr client = parseCode( + "class App\n" + "{\n" + "public:\n" + " App() {}\n" + "};\n" + "int main()\n" + "{\n" + " App();\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 1); + TS_ASSERT_EQUALS(client->calls[0], "int main() -> void App::App() <8:2 8:4>"); + } + + void test_cxx_parser_finds_explicit_constructor_call_of_field() + { + std::shared_ptr client = parseCode( + "class Item\n" + "{\n" + "};\n" + "class App\n" + "{\n" + "public:\n" + " App() : item() {}\n" + " Item item;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 1); + TS_ASSERT_EQUALS(client->calls[0], "void App::App() -> void Item::Item() <7:10 7:13>"); + } + + void test_cxx_parser_finds_function_call_in_member_initialization() + { + std::shared_ptr client = parseCode( + "int one() { return 1; }\n" + "class Item\n" + "{\n" + "public:\n" + " Item(int n) {}\n" + "};\n" + "class App\n" + "{\n" + " App()\n" + " : item(one())" + " {}\n" + " Item item;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 2); + TS_ASSERT_EQUALS(client->calls[0], "void App::App() -> void Item::Item(int) <10:5 10:8>"); + TS_ASSERT_EQUALS(client->calls[1], "void App::App() -> int one() <10:10 10:12>"); + } + + void test_cxx_parser_finds_copy_constructor_call() + { + std::shared_ptr client = parseCode( + "class App\n" + "{\n" + "public:\n" + " App() {}\n" + " App(const App& other) {}\n" + "};\n" + "int main()\n" + "{\n" + " App app;\n" + " App app2(app);\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 2); + TS_ASSERT_EQUALS(client->calls[0], "int main() -> void App::App() <9:6 9:8>"); + TS_ASSERT_EQUALS(client->calls[1], "int main() -> void App::App(App const &) <10:6 10:9>"); + } + + void test_cxx_parser_finds_global_variable_constructor_call() + { + std::shared_ptr client = parseCode( + "class App\n" + "{\n" + "public:\n" + " App() {}\n" + "};\n" + "App app;\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 1); + TS_ASSERT_EQUALS(client->calls[0], "app -> void App::App() <6:5 6:7>"); + } + + void test_cxx_parser_finds_global_variable_function_call() + { + std::shared_ptr client = parseCode( + "int one() { return 1; }\n" + "int a = one();\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 1); + TS_ASSERT_EQUALS(client->calls[0], "a -> int one() <2:9 2:11>"); + } + + void test_cxx_parser_finds_operator_call() + { + std::shared_ptr client = parseCode( + "class App\n" + "{\n" + "public:\n" + " void operator+(int a)\n" + " {\n" + " }\n" + "};\n" + "int main()\n" + "{\n" + " App app;\n" + " app + 2;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 2); + TS_ASSERT_EQUALS(client->calls[0], "int main() -> void App::App() <10:6 10:8>"); + TS_ASSERT_EQUALS(client->calls[1], "int main() -> void App::operator+(int) <11:6 11:6>"); + } + + void test_cxx_parser_finds_usage_of_global_variable_in_function() + { + std::shared_ptr client = parseCode( + "int bar;\n" + "\n" + "int main()\n" + "{\n" + " bar = 1;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->usages.size(), 1); + TS_ASSERT_EQUALS(client->usages[0], "int main() -> bar <5:2 5:4>"); + } + + void test_cxx_parser_finds_usage_of_global_variable_in_global_variable_initialization() + { + std::shared_ptr client = parseCode( + "int a = 0;\n" + "int b[] = {a};\n" + ); + + TS_ASSERT_EQUALS(client->usages.size(), 2); // FIXME: this usage is recorded twice (by InitList and ImplicitCast) + TS_ASSERT_EQUALS(client->usages[0], "b -> a <2:12 2:12>"); + } + + void test_cxx_parser_finds_usage_of_global_variable_in_method() + { + std::shared_ptr client = parseCode( + "int bar;\n" + "\n" + "class App\n" + "{\n" + " void foo()\n" + " {\n" + " bar = 1;\n" + " }\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->usages.size(), 1); + TS_ASSERT_EQUALS(client->usages[0], "void App::foo() -> bar <7:3 7:5>"); + } + + void test_cxx_parser_finds_usage_of_field_in_method() + { + std::shared_ptr client = parseCode( + "class App\n" + "{\n" + " void foo()\n" + " {\n" + " bar = 1;\n" + " this->bar = 2;\n" + " }\n" + " int bar;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->usages.size(), 2); + TS_ASSERT_EQUALS(client->usages[0], "void App::foo() -> App::bar <5:3 5:5>"); + TS_ASSERT_EQUALS(client->usages[1], "void App::foo() -> App::bar <6:9 6:11>"); + } + + void test_cxx_parser_finds_usage_of_field_in_initialization_list() + { + std::shared_ptr client = parseCode( + "class App\n" + "{\n" + " App()\n" + " : bar(42)\n" + " {}\n" + " int bar;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->usages.size(), 1); + TS_ASSERT_EQUALS(client->usages[0], "void App::App() -> App::bar <4:5 4:7>"); + } + + void test_cxx_parser_finds_return_type_use_in_function() + { + std::shared_ptr client = parseCode( + "double PI()\n" + "{\n" + " return 3.14159265359;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 1); + TS_ASSERT_EQUALS(client->typeUses[0], "double PI() -> double <1:1 1:6>"); + } + + void test_cxx_parser_finds_parameter_type_uses_in_function() + { + std::shared_ptr client = parseCode( + "void ceil(float a)\n" + "{\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 2); + TS_ASSERT_EQUALS(client->typeUses[0], "void ceil(float) -> void <1:1 1:4>"); + TS_ASSERT_EQUALS(client->typeUses[1], "void ceil(float) -> float <1:11 1:15>"); + } + + void test_cxx_parser_finds_parameter_type_uses_in_constructor() + { + std::shared_ptr client = parseCode( + "class A\n" + "{\n" + " A(int a);\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 1); + TS_ASSERT_EQUALS(client->typeUses[0], "void A::A(int) -> int <3:4 3:6>"); + } + + void test_cxx_parser_finds_type_uses_in_function_body() + { + std::shared_ptr client = parseCode( + "int main()\n" + "{\n" + " int a = 42;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 2); + TS_ASSERT_EQUALS(client->typeUses[0], "int main() -> int <1:1 1:3>"); + TS_ASSERT_EQUALS(client->typeUses[1], "int main() -> int <3:2 3:4>"); + } + + void test_cxx_parser_finds_type_uses_in_method_body() + { + std::shared_ptr client = parseCode( + "class A\n" + "{\n" + " int main()\n" + " {\n" + " int a = 42;\n" + " return a;\n" + " }\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 2); + TS_ASSERT_EQUALS(client->typeUses[0], "int A::main() -> int <3:2 3:4>"); + TS_ASSERT_EQUALS(client->typeUses[1], "int A::main() -> int <5:3 5:5>"); + } + + void test_cxx_parser_finds_type_uses_in_loops_and_conditions() + { + std::shared_ptr client = parseCode( + "int main()\n" + "{\n" + " if (true)\n" + " {\n" + " int a = 42;\n" + " }\n" + " for (int i = 0; i < 10; i++)\n" + " {\n" + " int b = i * 2;\n" + " }\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 4); + TS_ASSERT_EQUALS(client->typeUses[0], "int main() -> int <1:1 1:3>"); + TS_ASSERT_EQUALS(client->typeUses[1], "int main() -> int <5:3 5:5>"); + TS_ASSERT_EQUALS(client->typeUses[2], "int main() -> int <7:7 7:9>"); + TS_ASSERT_EQUALS(client->typeUses[3], "int main() -> int <9:3 9:5>"); + } + + void test_cxx_parser_finds_type_uses_of_base_class_in_derived_constructor() + { + std::shared_ptr client = parseCode( + "class A\n" + "{\n" + "public:\n" + " A(int n) {}" + "};\n" + "class B : public A\n" + "{\n" + "public:\n" + " B() : A(42) {}\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 2); + TS_ASSERT_EQUALS(client->typeUses[0], "void A::A(int) -> int <4:4 4:6>"); + TS_ASSERT_EQUALS(client->typeUses[1], "void B::B() -> A <8:8 8:8>"); + } + + void test_cxx_parser_finds_enum_uses_in_global_space() + { + std::shared_ptr client = parseCode( + "enum A\n" + "{\n" + " B,\n" + " C\n" + "};\n" + "A a = B;\n" + "A* aPtr = new A;\n" + ); + + TS_ASSERT_EQUALS(client->usages.size(), 1); + TS_ASSERT_EQUALS(client->usages[0], "a -> A::B <6:7 6:7>"); + TS_ASSERT_EQUALS(client->typeUses.size(), 3); + TS_ASSERT_EQUALS(client->typeUses[0], "a -> A <6:1 6:1>"); + TS_ASSERT_EQUALS(client->typeUses[1], "aPtr -> A <7:1 7:1>"); + TS_ASSERT_EQUALS(client->typeUses[2], "aPtr -> A <7:15 7:15>"); + TS_ASSERT_EQUALS(client->globalVariables.size(), 2); + TS_ASSERT_EQUALS(client->globalVariables[0], "a <6:3 6:3>"); + TS_ASSERT_EQUALS(client->globalVariables[1], "aPtr <7:4 7:7>"); + } + + void test_cxx_parser_finds_enum_uses_in_function_body() + { + std::shared_ptr client = parseCode( + "enum A\n" + "{\n" + " B,\n" + " C\n" + "};\n" + "int main()\n" + "{\n" + " A a = B;\n" + " A* aPtr = new A;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->usages.size(), 1); + TS_ASSERT_EQUALS(client->usages[0], "int main() -> A::B <8:8 8:8>"); + TS_ASSERT_EQUALS(client->typeUses.size(), 4); + TS_ASSERT_EQUALS(client->typeUses[0], "int main() -> int <6:1 6:3>"); + TS_ASSERT_EQUALS(client->typeUses[1], "int main() -> A <8:2 8:2>"); + TS_ASSERT_EQUALS(client->typeUses[2], "int main() -> A <9:2 9:2>"); + TS_ASSERT_EQUALS(client->typeUses[3], "int main() -> A <9:16 9:16>"); + } + + void test_cxx_parser_finds_macro_expand() + { + std::shared_ptr client = parseCode( + "#define PI 3.14159265359\n" + "void test()\n" + "{\n" + "double i = PI;" + "};\n" + ); + TS_ASSERT_EQUALS(client->macroUses.size(), 1); + TS_ASSERT_EQUALS(client->macroUses[0], "PI <4:12 4:13>"); + } + + void test_cxx_parser_finds_usage_of_template_template_parameter_of_template_class_specialized_with_concrete_type() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{};\n" + "template class T>\n" + "class B\n" + "{\n" + " void foo(T parameter)\n" + " {}\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 2); + TS_ASSERT_EQUALS(client->typeUses[0], "void B typename T>::foo(B typename T>::T) -> void <7:2 7:5>"); + TS_ASSERT_EQUALS(client->typeUses[1], "void B typename T>::foo(B typename T>::T) -> B typename T>::T <7:11 7:11>"); + } + + void test_cxx_parser_finds_usage_of_template_template_parameter_of_template_class_specialized_with_template_type() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{};\n" + "template class T>\n" + "class B\n" + "{\n" + " template \n" + " void foo(T parameter)\n" + " {}\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->typeUses.size(), 2); + TS_ASSERT_EQUALS(client->typeUses[0], "void B typename T>::foo(B typename T>::T) -> void <8:2 8:5>"); + TS_ASSERT_EQUALS(client->typeUses[1], "void B typename T>::foo(B typename T>::T) -> B typename T>::T typename T>::foo::U> <8:11 8:11>"); + } + + void test_cxx_parser_finds_typedef_in_other_class_that_depends_on_own_template_parameter() { std::shared_ptr client = parseCode( "template \n" "class A\n" "{\n" - " int foo();\n" + "public:\n" + " typedef T type;\n" + "};\n" + "template \n" + "class B\n" + "{\n" + "public:\n" + " typedef typename A::type type;\n" "};\n" - ); - TS_ASSERT_EQUALS(client->methods.size(), 1); - TS_ASSERT_EQUALS(client->methods[0], "private int A::foo() <4:6 4:8>"); + "B::type f = 0;\n" + + ); + + TS_ASSERT_EQUALS(client->typedefs.size(), 4); + TS_ASSERT_EQUALS(client->typedefs[0], "public A::type <5:12 5:15>"); + TS_ASSERT_EQUALS(client->typedefs[1], "public A::type <5:12 5:15>"); + TS_ASSERT_EQUALS(client->typedefs[2], "public B::type <11:30 11:33>"); + TS_ASSERT_EQUALS(client->typedefs[3], "public B::type <11:30 11:33>"); + + TS_ASSERT_EQUALS(client->typeUses.size(), 4); + TS_ASSERT_EQUALS(client->typeUses[0], "A::type -> A::T <5:10 5:10>"); + TS_ASSERT_EQUALS(client->typeUses[1], "B::type -> A::U>::type <11:25 11:28>"); + TS_ASSERT_EQUALS(client->typeUses[2], "B::type -> A::type <11:25 11:28>"); + TS_ASSERT_EQUALS(client->typeUses[3], "f -> B::type <13:9 13:12>"); + //TS_ASSERT_EQUALS(client->typeUses[3], "A::type -> int <13:9 13:12>"); TODO: make this work! + } + + void test_cxx_parser_finds_type_template_argument_of_explicit_template_instantiation() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "int main()\n" + "{\n" + " A a;\n" + " return 0;\n" + "}\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->int <7:4 7:6>"); + } + void test_cxx_parser_finds_type_template_argument_for_parameter_pack_of_explicit_template_instantiation() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "int main()\n" + "{\n" + " A();\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<>->int <7:6 7:8>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<>->float <7:11 7:15>"); + } + + void test_cxx_parser_finds_type_template_argument_in_non_default_constructor_of_explicit_template_instaitiation() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "public:\n" + " A(int data){}\n" + "};\n" + "int main()\n" + "{\n" + " A(5);\n" + "}\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->int <9:4 9:6>"); + } + + void test_cxx_parser_finds_type_template_argument_in_default_constructor_of_explicit_template_instaitiation() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "public:\n" + " A(){}\n" + "};\n" + "int main()\n" + "{\n" + " A();\n" + "}\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->int <9:4 9:6>"); + } + + void test_cxx_parser_finds_type_template_argument_in_new_expression_of_explicit_template_instaitiation() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "public:\n" + " A(){}\n" + "};\n" + "int main()\n" + "{\n" + " new A();\n" + "}\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->int <9:8 9:10>"); + } + + void test_cxx_parser_finds_no_template_argument_for_builtin_non_type_int_template_parameter_of_explicit_template_instantiation() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "int main()\n" + "{\n" + " A<1> a;\n" + " return 0;\n" + "}\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 0); + } + + void test_cxx_parser_finds_no_template_argument_for_builtin_non_type_bool_template_parameter_of_explicit_template_instantiation() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "int main()\n" + "{\n" + " A a;\n" + " return 0;\n" + "}\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 0); + } + + void test_cxx_parser_finds_non_type_custom_pointer_template_argument_of_implicit_template_instantiation() + { + std::shared_ptr client = parseCode( + "class P\n" + "{};\n" + "template \n" + "class A\n" + "{};\n" + "P g_p;\n" + "int main()\n" + "{\n" + " A<&g_p> a;\n" + "}\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&g_p>->g_p <9:5 9:7>"); + } + + void test_cxx_parser_finds_non_type_custom_reference_template_argument_of_implicit_template_instantiation() + { + std::shared_ptr client = parseCode( + "class P\n" + "{};\n" + "template \n" + "class A\n" + "{};\n" + "P g_p;\n" + "int main()\n" + "{\n" + " A a;\n" + "}\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&g_p>->g_p <9:4 9:6>"); + } + + void test_cxx_parser_finds_no_template_argument_for_builtin_non_type_int_template_parameter_pack_of_explicit_template_instantiation() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "int main()\n" + "{\n" + " A<1, 2, 33>();\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 0); + } + + void test_cxx_parser_finds_template_template_argument_of_explicit_template_instantiation() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{};\n" + "template class T>\n" + "class B\n" + "{};\n" + "int main()\n" + "{\n" + " B ba;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "B->A <9:4 9:4>"); + } + + void test_cxx_parser_finds_template_template_argument_for_parameter_pack_of_explicit_template_instantiation() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template typename... T>\n" + "class B\n" + "{\n" + "};\n" + "int main()\n" + "{\n" + " B();\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "B<>->A <11:4 11:4>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "B<>->A <11:7 11:7>"); + } + + void test_cxx_parser_finds_template_member_specialization_of_implicit_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "public:\n" + " T foo() {}\n" + "};\n" + "int main()\n" + "{\n" + " A a;\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->templateMemberSpecializations.size(), 1); + TS_ASSERT_EQUALS(client->templateMemberSpecializations[0], "int A::foo() -> A::T A::foo() <5:4 5:6>"); + } + + void test_cxx_parser_finds_type_template_argument_of_explicit_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template <>\n" + "class A\n" + "{\n" + "};\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->int <6:9 6:11>"); + } + + void test_cxx_parser_finds_no_template_argument_for_builtin_non_type_int_template_parameter_of_explicit_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template <>\n" + "class A<1>\n" + "{\n" + "};\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 0); + } + + void test_cxx_parser_finds_no_template_argument_for_builtin_non_type_bool_template_parameter_of_explicit_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template <>\n" + "class A\n" + "{\n" + "};\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 0); + } + + void test_cxx_parser_finds_non_type_custom_pointer_template_argument_of_explicit_template_specialization() + { + std::shared_ptr client = parseCode( + "class P\n" + "{};\n" + "template \n" + "class A\n" + "{};\n" + "P g_p;\n" + "template <>\n" + "class A<&g_p>\n" + "{\n" + "};\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&g_p>->g_p <8:10 8:12>"); + } + + void test_cxx_parser_finds_non_type_custom_reference_template_argument_of_explicit_template_specialization() + { + std::shared_ptr client = parseCode( + "class P\n" + "{};\n" + "template \n" + "class A\n" + "{};\n" + "P g_p;\n" + "template <>\n" + "class A\n" + "{\n" + "};\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&g_p>->g_p <8:9 8:11>"); + } + + void test_cxx_parser_finds_template_template_argument_of_explicit_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{};\n" + "template class T>\n" + "class B\n" + "{};\n" + "template <>\n" + "class B\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "B->A <8:9 8:9>"); + } + + void test_cxx_parser_finds_type_template_argument_of_explicit_partial_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template \n" + "class A\n" + "{\n" + "};\n" + ); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->A::T <6:9 6:9>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A->int <6:12 6:14>"); + } + + void test_cxx_parser_finds_no_template_argument_for_builtin_non_type_int_template_parameter_of_explicit_partial_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template \n" + "class A<3, U>\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<3, int U>->A<3, int U>::U <6:12 6:12>"); + } + + void test_cxx_parser_finds_no_template_argument_for_builtin_non_type_bool_template_parameter_of_explicit_partial_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A->A::U <6:15 6:15>"); + } + + void test_cxx_parser_finds_template_argument_for_non_type_custom_pointer_template_parameter_of_explicit_partial_template_specialization() + { + std::shared_ptr client = parseCode( + "class P\n" + "{};\n" + "template \n" + "class A\n" + "{};\n" + "P g_p;\n" + "template \n" + "class A<&g_p, q>\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&g_p, P * q>->g_p <8:10 8:12>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<&g_p, P * q>->A<&g_p, P * q>::q <8:15 8:15>"); + } + + void test_cxx_parser_finds_template_argument_for_non_type_custom_reference_template_parameter_of_explicit_partial_template_specialization() + { + std::shared_ptr client = parseCode( + "class P\n" + "{};\n" + "template \n" + "class A\n" + "{};\n" + "P g_p;\n" + "template \n" + "class A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<&g_p, P & q>->g_p <8:9 8:11>"); // why reference here? + TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<&g_p, P & q>->A<&g_p, P & q>::q <8:14 8:14>"); + } + + void test_cxx_parser_finds_template_argument_for_template_template_parameter_of_explicit_partial_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{};\n" + "template class T, template class U>\n" + "class B\n" + "{};\n" + "template class U>\n" + "class B\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "B typename U>->A <8:9 8:9>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "B typename U>->B typename U>::U <8:12 8:12>"); + } + + void test_cxx_parser_finds_non_type_template_argument_that_depends_on_type_template_parameter_of_explicit_partial_template_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + "};\n" + "template \n" + "class A<3, T2, T3>\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<3, typename T2, T2 T3>->A<3, typename T2, T2 T3>::T2 <6:12 6:13>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<3, typename T2, T2 T3>->A<3, typename T2, T2 T3>::T3 <6:16 6:17>"); + } + + //void _test_cxx_parser_finds_non_type_template_argument_that_depends_on_template_template_parameter_of_explicit_partial_template_specialization() + //{ + // std::shared_ptr client = parseCode( + // "template class T2, T2 T3>\n" + // "class A\n" + // "{\n" + // "};\n" + // "template class T2, T2 T3>\n" + // "class A<3, T2, T3>\n" + // "{\n" + // "};\n" + // ); + + // TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 2); + // TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<3, template typename T2, T2 T3>->A<3, template typename T2, T2 T3>::T2 <6:12 6:13>"); + // TS_ASSERT_EQUALS(client->templateArgumentTypes[1], "A<3, template typename T2, T2 T3>->A<3, template typename T2, T2 T3>::T3 <6:16 6:17>"); + //} + + void test_cxx_parser_finds_implicit_template_class_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + " T foo;\n" + "};\n" + "\n" + "A a;\n" + ); + + TS_ASSERT_EQUALS(client->templateSpecializations.size(), 1); + TS_ASSERT_EQUALS(client->templateSpecializations[0], "A -> A <2:7 2:7>"); + } + + void test_cxx_parser_finds_class_inheritance_from_implicit_template_class_specialization() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + " T foo;\n" + "};\n" + "\n" + "class B: public A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->inheritances.size(), 1); + TS_ASSERT_EQUALS(client->inheritances[0], "B : public A <7:17 7:17>"); + } + + void test_cxx_parser_finds_template_class_specialization_with_template_argument() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + " T foo;\n" + "};\n" + "\n" + "template \n" + "class B: public A\n" + "{\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A::U>->B::U <8:19 8:19>"); + } + + void test_cxx_parser_finds_template_class_constructor_usage_of_field() + { + std::shared_ptr client = parseCode( + "template \n" + "class A\n" + "{\n" + " A(): foo() {}\n" + " T foo;\n" + "};\n" + ); + + TS_ASSERT_EQUALS(client->usages.size(), 1); + TS_ASSERT_EQUALS(client->usages[0], "void A::A() -> A::foo <4:7 4:9>"); } void test_cxx_parser_finds_correct_method_return_type_of_template_class_in_declaration() @@ -2358,10 +2365,10 @@ public: "{\n" " T foo();\n" "};\n" - ); + ); - TS_ASSERT_EQUALS(client->methods.size(), 1); - TS_ASSERT_EQUALS(client->methods[0], "private A::T A::foo() <4:4 4:6>"); + TS_ASSERT_EQUALS(client->typeUses.size(), 1); + TS_ASSERT_EQUALS(client->typeUses[0], "A::T A::foo() -> A::T <4:2 4:2>"); } void test_cxx_parser_finds_type_template_default_argument_type_of_template_class() @@ -2371,20 +2378,20 @@ public: "class A\n" "{\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->templateDefaultArgumentTypes.size(), 1); TS_ASSERT_EQUALS(client->templateDefaultArgumentTypes[0], "int -> A::T <1:24 1:26>"); } - void test_cxx_parser_does_not_find_default_argument_type_for_non_type_bool_template_parameter_of_template_class() + void test_cxx_parser_finds_no_default_argument_type_for_non_type_bool_template_parameter_of_template_class() { std::shared_ptr client = parseCode( "template \n" "class A\n" "{\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->templateDefaultArgumentTypes.size(), 0); } @@ -2398,122 +2405,13 @@ public: "template class T = A>\n" "class B\n" "{};\n" - ); + ); TS_ASSERT_EQUALS(client->templateDefaultArgumentTypes.size(), 1); TS_ASSERT_EQUALS(client->templateDefaultArgumentTypes[0], "A -> B typename T>::T <4:40 4:40>"); } - - - void test_cxx_parser_finds_type_template_parameter_of_template_function() - { - std::shared_ptr client = parseCode( - "template \n" - "T test(T a)\n" - "{\n" - " return a;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test::T <1:20 1:20>"); - } - - void test_cxx_parser_finds_non_type_int_template_parameter_of_template_function() - { - std::shared_ptr client = parseCode( - "template \n" - "int test(int a)\n" - "{\n" - " return a + T;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test::T <1:15 1:15>"); - } - - void test_cxx_parser_finds_non_type_bool_template_parameter_of_template_function() - { - std::shared_ptr client = parseCode( - "template \n" - "int test(int a)\n" - "{\n" - " return T ? a : 0;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test::T <1:16 1:16>"); - } - - void test_cxx_parser_finds_non_type_custom_pointer_template_parameter_of_template_function() - { - std::shared_ptr client = parseCode( - "class P\n" - "{};\n" - "template \n" - "int test(int a)\n" - "{\n" - " return a;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test

::p <3:14 3:14>"); - } - - void test_cxx_parser_finds_non_type_custom_reference_template_parameter_of_template_function() - { - std::shared_ptr client = parseCode( - "class P\n" - "{};\n" - "template \n" - "int test(int a)\n" - "{\n" - " return a;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test

::p <3:14 3:14>"); - } - - void test_cxx_parser_finds_non_type_nullptr_template_parameter_of_template_function() - { - std::shared_ptr client = parseCode( - "#include \n" - "template \n" - "int test(int a)\n" - "{\n" - " return a;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "test::T <2:26 2:26>"); - } - - void test_cxx_parser_finds_template_template_parameter_of_template_function() - { - std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{};\n" - "template class T>\n" - "int test(int a)\n" - "{\n" - " return a;\n" - "};\n" - ); - - TS_ASSERT_EQUALS(client->templateParameterTypes.size(), 2); - TS_ASSERT_EQUALS(client->templateParameterTypes[0], "A::T <1:20 1:20>"); - TS_ASSERT_EQUALS(client->templateParameterTypes[1], "test typename T>::T <4:36 4:36>"); - } - - void test_cxx_parser_finds_implicit_specialization_of_template_function() + void test_cxx_parser_finds_implicit_instantiation_of_template_function() { std::shared_ptr client = parseCode( "template \n" @@ -2526,10 +2424,10 @@ public: "{\n" " return test(1);\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->templateSpecializations.size(), 1); - TS_ASSERT_EQUALS(client->templateSpecializations[0], "int test(int) -> test::T test(test::T) <2:3 2:6>"); + TS_ASSERT_EQUALS(client->templateSpecializations[0], "int test(int) -> T test(T) <2:3 2:6>"); } void test_cxx_parser_finds_explicit_specialization_of_template_function() @@ -2546,13 +2444,13 @@ public: "{\n" " return a + a;\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->templateSpecializations.size(), 1); - TS_ASSERT_EQUALS(client->templateSpecializations[0], "int test(int) -> test::T test(test::T) <8:5 8:8>"); + TS_ASSERT_EQUALS(client->templateSpecializations[0], "int test(int) -> T test(T) <8:5 8:8>"); } - void test_cxx_parser_finds_explicit_type_template_argument_of_explicit_specialization_of_template_function() + void test_cxx_parser_finds_explicit_type_template_argument_of_explicit_instantiation_of_template_function() { std::shared_ptr client = parseCode( "template \n" @@ -2564,9 +2462,9 @@ public: "void test()\n" "{\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "void test()->int <7:11 7:11>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "void test()->int <7:11 7:13>"); } void test_cxx_parser_finds_explicit_type_template_argument_of_function_call_in_function() @@ -2582,10 +2480,10 @@ public: "};\n" ); TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "void test()->int <6:7 6:7>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "void test()->int <6:7 6:9>"); } - void test_cxx_parser_finds_explicit_non_type_template_argument_of_function_call_in_function() + void test_cxx_parser_finds_no_explicit_non_type_int_template_argument_of_function_call_in_function() { std::shared_ptr client = parseCode( "template \n" @@ -2597,8 +2495,7 @@ public: " return 1;\n" "};\n" ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "void test<33>()->int <6:7 6:7>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 0); } void test_cxx_parser_finds_explicit_template_template_argument_of_function_call_in_function() @@ -2618,7 +2515,7 @@ public: TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "void test()->A <7:7 7:7>"); } - void test_cxx_parser_finds_implicit_type_template_argument_of_function_call_in_function() + void test_cxx_parser_finds_no_implicit_type_template_argument_of_function_call_in_function() { std::shared_ptr client = parseCode( "template \n" @@ -2630,8 +2527,7 @@ public: " return 1;\n" "};\n" ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "void test(int)->int <6:5 6:5>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 0); } void test_cxx_parser_finds_explicit_type_template_argument_of_function_call_in_var_decl() @@ -2646,10 +2542,10 @@ public: "};\n" ); TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "int test()->int <6:17 6:17>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "int test()->int <6:17 6:19>"); } - void test_cxx_parser_finds_implicit_type_template_argument_of_function_call_in_var_decl() + void test_cxx_parser_finds_no_implicit_type_template_argument_of_function_call_in_var_decl() { std::shared_ptr client = parseCode( "template \n" @@ -2660,13 +2556,9 @@ public: " int foo = test(1);\n" "};\n" ); - TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); - TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "int test(int)->int <6:15 6:15>"); + TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 0); } - - - void test_cxx_parser_finds_type_template_default_argument_type_of_template_function() { std::shared_ptr client = parseCode( @@ -2677,10 +2569,10 @@ public: "\n" "int main()\n" "{\n" - " test();\n" + " test();\n" " return 1;\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->templateDefaultArgumentTypes.size(), 1); TS_ASSERT_EQUALS(client->templateDefaultArgumentTypes[0], "int -> test::T <1:24 1:26>"); } @@ -2692,7 +2584,7 @@ public: "void test()\n" "{\n" "};\n" - ); + ); TS_ASSERT_EQUALS(client->templateDefaultArgumentTypes.size(), 0); } @@ -2700,14 +2592,14 @@ public: void test_cxx_parser_finds_template_template_default_argument_type_of_template_function() { std::shared_ptr client = parseCode( - "template \n" - "class A\n" - "{};\n" - "template class T = A>\n" - "void test()\n" - "{\n" - "};\n" - ); + "template \n" + "class A\n" + "{};\n" + "template class T = A>\n" + "void test()\n" + "{\n" + "};\n" + ); TS_ASSERT_EQUALS(client->templateDefaultArgumentTypes.size(), 1); TS_ASSERT_EQUALS( @@ -2715,23 +2607,7 @@ public: "A -> test typename T>::T <4:40 4:40>"); } - void test_cxx_parser_finds_lambda_in_function() - { - std::shared_ptr client = parseCode( - "void lambdaCaller()\n" - "{\n" - " [](){}();\n" - "}\n" - ); - - TS_ASSERT_EQUALS(client->functions.size(), 2); - TS_ASSERT_EQUALS(client->functions[0], "void lambdaCaller() <1:1 <1:6 1:17> 4:1>"); - TS_ASSERT_EQUALS(client->functions[1], "void lambdaCaller::lambda at 3:2() const <3:5 <3:2 3:2> 3:7>"); - TS_ASSERT_EQUALS(client->calls.size(), 1); - TS_ASSERT_EQUALS(client->calls[0], "void lambdaCaller() -> void lambdaCaller::lambda at 3:2() const <3:2 3:9>"); - } - - void test_cxx_parser_ignores_lambda_in_function_but_still_finds_call_within() + void test_cxx_parser_finds_lambda_calling_a_function() { std::shared_ptr client = parseCode( "void func() {}\n" @@ -2742,17 +2618,76 @@ public: " func();\n" " }();\n" "}\n" - ); + ); - TS_ASSERT_EQUALS(client->functions.size(), 3); - TS_ASSERT_EQUALS(client->functions[0], "void func() <1:1 <1:6 1:9> 1:14>"); - TS_ASSERT_EQUALS(client->functions[1], "void lambdaCaller() <2:1 <2:6 2:17> 8:1>"); - TS_ASSERT_EQUALS(client->functions[2], "void lambdaCaller::lambda at 4:2() const <4:5 <4:2 4:2> 7:2>"); TS_ASSERT_EQUALS(client->calls.size(), 2); - TS_ASSERT_EQUALS(client->calls[0], "void lambdaCaller() -> void lambdaCaller::lambda at 4:2() const <4:2 7:4>"); - TS_ASSERT_EQUALS(client->calls[1], "void lambdaCaller::lambda at 4:2() const -> void func() <6:3 6:8>"); + TS_ASSERT_EQUALS(client->calls[0], "void lambdaCaller() -> void lambdaCaller::lambda at 4:2() <7:3 7:3>"); + TS_ASSERT_EQUALS(client->calls[1], "void lambdaCaller::lambda at 4:2() -> void func() <6:3 6:6>"); } + /////////////////////////////////////////////////////////////////////////////// + // test finding symbol locations + + void test_cxx_parser_finds_correct_location_of_explicit_constructor_defined_in_namespace() + { + std::shared_ptr client = parseCode( + "namespace n\n" + "{\n" + " class App\n" + " {\n" + " public:\n" + " App(int i) {}\n" + " };\n" + "}\n" + "int main()\n" + "{\n" + " n::App a = n::App(2);\n" + "}\n" + ); + + TS_ASSERT_EQUALS(client->calls.size(), 2); + TS_ASSERT_EQUALS(client->calls[1], "int main() -> void n::App::App(int) <11:16 11:18>"); + } + + void test_cxx_parser_finds_macro_define_scope() + { + std::shared_ptr client = parseCode( + "#define MAX(a,b) \\\n" + " ((a)>(b)?(a):(b))" + ); + TS_ASSERT_EQUALS(client->macros.size(), 1); + TS_ASSERT_EQUALS(client->macros[0], "MAX <1:9 <1:9 1:11> 2:17>"); + } + + //void __test_cxx_parser_finds_type_template_argument_of_static_cast_expression() + //{ + // std::shared_ptr client = parseCode( + // "int main()\n" + // "{\n" + // " return static_cast(4.0f);" + // "}\n" + // ); + // TS_ASSERT_EQUALS(client->templateArgumentTypes.size(), 1); + // TS_ASSERT_EQUALS(client->templateArgumentTypes[0], "A<1>->int <0:0 0:0>"); + //} + + //void _test_cxx_parser_finds_implicit_constructor_call_in_initialization() + //{ + // std::shared_ptr client = parseCode( + // "class A\n" + // "{\n" + // "};\n" + // "class B\n" + // "{\n" + // " B(){}\n" + // " A m_a;\n" + // "};\n" + // ); + + // TS_ASSERT_EQUALS(client->calls.size(), 1); + // TS_ASSERT_EQUALS(client->calls[0], "void B::B() -> A::A() <6:2 6:2>"); + //} + void test_cxx_parser_parses_multiple_files() { TestFileManager fm; @@ -2783,9 +2718,9 @@ public: TS_ASSERT_EQUALS(client.structs.size(), 1); TS_ASSERT_EQUALS(client.inheritances.size(), 1); - TS_ASSERT_EQUALS(client.calls.size(), 2); + TS_ASSERT_EQUALS(client.calls.size(), 1); TS_ASSERT_EQUALS(client.usages.size(), 3); - TS_ASSERT_EQUALS(client.typeUses.size(), 8); + TS_ASSERT_EQUALS(client.typeUses.size(), 19); TS_ASSERT_EQUALS(client.files.size(), 3); TS_ASSERT_EQUALS(client.includes.size(), 1); @@ -2823,7 +2758,7 @@ public: TS_ASSERT_EQUALS(client->comments[0], "comment <1:1 2:17>"); } - // void ___test_TEST() + // void _test_TEST() // { // std::shared_ptr client = parseCode( // "template class> class T>\n" @@ -2851,7 +2786,7 @@ private: { } - virtual void prepareParsingFile(const FilePath& filePath) + virtual void startParsingFile(const FilePath& filePath) { } @@ -2870,11 +2805,10 @@ private: } virtual Id onTypedefParsed( - const ParseLocation& location, const NameHierarchy& nameHierarchy, const ParseTypeUsage& underlyingType, - AccessType access + const ParseLocation& location, const NameHierarchy& typedefName, AccessType access ) { - std::string str = addAccessPrefix(underlyingType.dataType->getFullTypeName() + " -> " + nameHierarchy.getFullName(), access); + std::string str = addAccessPrefix(typedefName.getQualifiedName(), access); typedefs.push_back(addLocationSuffix(str, location)); return 0; } @@ -2883,7 +2817,7 @@ private: const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation) { - classes.push_back(addLocationSuffix(addAccessPrefix(nameHierarchy.getFullName(), access), location, scopeLocation)); + classes.push_back(addLocationSuffix(addAccessPrefix(nameHierarchy.getQualifiedName(), access), location, scopeLocation)); return 0; } @@ -2891,57 +2825,45 @@ private: const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation) { - structs.push_back(addLocationSuffix(addAccessPrefix(nameHierarchy.getFullName(), access), location, scopeLocation)); + structs.push_back(addLocationSuffix(addAccessPrefix(nameHierarchy.getQualifiedName(), access), location, scopeLocation)); return 0; } - virtual Id onGlobalVariableParsed(const ParseLocation& location, const ParseVariable& variable) + virtual Id onGlobalVariableParsed(const ParseLocation& location, const NameHierarchy& variable) { - globalVariables.push_back(addLocationSuffix(variableStr(variable), location)); + globalVariables.push_back(addLocationSuffix(variable.getQualifiedName(), location)); return 0; } - virtual Id onFieldParsed(const ParseLocation& location, const ParseVariable& variable, AccessType access) + virtual Id onFieldParsed(const ParseLocation& location, const NameHierarchy& field, AccessType access) { - fields.push_back(addLocationSuffix(addAccessPrefix(variableStr(variable), access), location)); + fields.push_back(addLocationSuffix(addAccessPrefix(field.getQualifiedName(), access), location)); return 0; } virtual Id onFunctionParsed( - const ParseLocation& location, const ParseFunction& function, const ParseLocation& scopeLocation - ){ - functions.push_back(addLocationSuffix(functionStr(function), location, scopeLocation)); - - addTypeUse(function.returnType); - for (const ParseTypeUsage& parameter : function.parameters) - { - addTypeUse(parameter); - } + const ParseLocation& location, const NameHierarchy& function, const ParseLocation& scopeLocation) + { + functions.push_back(addLocationSuffix(function.getQualifiedNameWithSignature(), location, scopeLocation)); return 0; } virtual Id onMethodParsed( - const ParseLocation& location, const ParseFunction& method, AccessType access, AbstractionType abstraction, - const ParseLocation& scopeLocation - ){ - std::string str = functionStr(method); + const ParseLocation& location, const NameHierarchy& method, AccessType access, AbstractionType abstraction, + const ParseLocation& scopeLocation) + { + std::string str = method.getQualifiedNameWithSignature(); str = addAbstractionPrefix(str, abstraction); str = addAccessPrefix(str, access); str = addLocationSuffix(str, location, scopeLocation); methods.push_back(str); - - addTypeUse(method.returnType); - for (const ParseTypeUsage& parameter : method.parameters) - { - addTypeUse(parameter); - } return 0; } virtual Id onNamespaceParsed( const ParseLocation& location, const NameHierarchy& nameHierarchy, const ParseLocation& scopeLocation) { - namespaces.push_back(addLocationSuffix(nameHierarchy.getFullName(), location, scopeLocation)); + namespaces.push_back(addLocationSuffix(nameHierarchy.getQualifiedName(), location, scopeLocation)); return 0; } @@ -2949,176 +2871,115 @@ private: const ParseLocation& location, const NameHierarchy& nameHierarchy, AccessType access, const ParseLocation& scopeLocation) { - enums.push_back(addLocationSuffix(addAccessPrefix(nameHierarchy.getFullName(), access), location, scopeLocation)); + enums.push_back(addLocationSuffix(addAccessPrefix(nameHierarchy.getQualifiedName(), access), location, scopeLocation)); return 0; } virtual Id onEnumConstantParsed(const ParseLocation& location, const NameHierarchy& nameHierarchy) { - enumConstants.push_back(addLocationSuffix(nameHierarchy.getFullName(), location)); + enumConstants.push_back(addLocationSuffix(nameHierarchy.getQualifiedName(), location)); return 0; } virtual Id onInheritanceParsed( - const ParseLocation& location, const NameHierarchy& nameHierarchy, const NameHierarchy& baseNameHierarchy, AccessType access) + const ParseLocation& location, const NameHierarchy& childNameHierarchy, + const NameHierarchy& parentNameHierarchy, AccessType access) { - std::string str = nameHierarchy.getFullName() + " : " + addAccessPrefix(baseNameHierarchy.getFullName(), access); + std::string str = childNameHierarchy.getQualifiedName() + " : " + addAccessPrefix(parentNameHierarchy.getQualifiedName(), access); inheritances.push_back(addLocationSuffix(str, location)); return 0; } - virtual Id onMethodOverrideParsed(const ParseLocation& location, const ParseFunction& base, const ParseFunction& overrider) + virtual Id onMethodOverrideParsed( + const ParseLocation& location, const NameHierarchy& overridden, const NameHierarchy& overrider) { - overrides.push_back(addLocationSuffix(functionStr(base) + " -> " + functionStr(overrider), location)); + overrides.push_back(addLocationSuffix(overridden.getQualifiedNameWithSignature() + " -> " + overrider.getQualifiedNameWithSignature(), location)); return 0; } virtual Id onCallParsed( - const ParseLocation& location, const ParseFunction& caller, const ParseFunction& callee) + const ParseLocation& location, const NameHierarchy& caller, const NameHierarchy& callee) { - calls.push_back(addLocationSuffix(functionStr(caller) + " -> " + functionStr(callee), location)); - return 0; - } - - virtual Id onCallParsed( - const ParseLocation& location, const ParseVariable& caller, const ParseFunction& callee) - { - calls.push_back(addLocationSuffix(caller.getFullName() + " -> " + functionStr(callee), location)); + std::string callerSignature = caller.getQualifiedNameWithSignature(); + calls.push_back(addLocationSuffix(caller.getQualifiedNameWithSignature() + " -> " + callee.getQualifiedNameWithSignature(), location)); return 0; } virtual Id onFieldUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy) + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy) { - usages.push_back(addLocationSuffix(functionStr(user) + " -> " + usedNameHierarchy.getFullName(), location)); - return 0; - } - - virtual Id onFieldUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy) - { - usages.push_back(addLocationSuffix(variableStr(user) + " -> " + usedNameHierarchy.getFullName(), location)); + usages.push_back(addLocationSuffix(userNameHierarchy.getQualifiedNameWithSignature() + " -> " + usedNameHierarchy.getQualifiedName(), location)); return 0; } virtual Id onGlobalVariableUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy) + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy) { - usages.push_back(addLocationSuffix(functionStr(user) + " -> " + usedNameHierarchy.getFullName(), location)); - return 0; - } - - virtual Id onGlobalVariableUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy) - { - usages.push_back(addLocationSuffix(variableStr(user) + " -> " + usedNameHierarchy.getFullName(), location)); + usages.push_back(addLocationSuffix(userNameHierarchy.getQualifiedNameWithSignature() + " -> " + usedNameHierarchy.getQualifiedName(), location)); return 0; } virtual Id onEnumConstantUsageParsed( - const ParseLocation& location, const ParseFunction& user, const NameHierarchy& usedNameHierarchy) + const ParseLocation& location, const NameHierarchy& userNameHierarchy, const NameHierarchy& usedNameHierarchy) { - usages.push_back(addLocationSuffix(functionStr(user) + " -> " + usedNameHierarchy.getFullName(), location)); + usages.push_back(addLocationSuffix(userNameHierarchy.getQualifiedNameWithSignature() + " -> " + usedNameHierarchy.getQualifiedName(), location)); return 0; } - virtual Id onEnumConstantUsageParsed( - const ParseLocation& location, const ParseVariable& user, const NameHierarchy& usedNameHierarchy) + virtual Id onTypeUsageParsed(const ParseLocation& location, const NameHierarchy& user, const NameHierarchy& used) { - usages.push_back(addLocationSuffix(variableStr(user) + " -> " + usedNameHierarchy.getFullName(), location)); + typeUses.push_back(addLocationSuffix(user.getQualifiedNameWithSignature() + " -> " + used.getQualifiedNameWithSignature(), location)); return 0; } - virtual Id onTypeUsageParsed(const ParseTypeUsage& type, const ParseFunction& function) - { - addTypeUse(type, function); - return 0; - } - - virtual Id onTypeUsageParsed(const ParseTypeUsage& type, const ParseVariable& variable) - { - addTypeUse(type); - return 0; - } - - virtual Id onTemplateArgumentTypeOfTemplateRecordParsed( + virtual Id onTemplateArgumentTypeParsed( const ParseLocation& location, const NameHierarchy& argumentTypeNameHierarchy, const NameHierarchy& templateNameHierarchy) { templateArgumentTypes.push_back( - addLocationSuffix(templateNameHierarchy.getFullName() + "->" + argumentTypeNameHierarchy.getFullName(), location) - ); - return 0; - } - - virtual Id onTemplateArgumentTypeOfTemplateFunctionParsed( - const ParseLocation& location, const NameHierarchy& argumentTypeNameHierarchy, - const ParseFunction& templateFunction) - { - templateArgumentTypes.push_back( - addLocationSuffix(functionStr(templateFunction) + "->" + argumentTypeNameHierarchy.getFullName(), location) + addLocationSuffix(templateNameHierarchy.getQualifiedNameWithSignature() + "->" + argumentTypeNameHierarchy.getQualifiedName(), location) ); return 0; } virtual Id onTemplateDefaultArgumentTypeParsed( - const ParseTypeUsage& defaultArgumentType, const NameHierarchy& templateArgumentTypeNameHierarchy) + const ParseLocation& location, const NameHierarchy& defaultArgumentTypeNameHierarchy, + const NameHierarchy& templateParameterNameHierarchy) { templateDefaultArgumentTypes.push_back( - addLocationSuffix(defaultArgumentType.dataType->getTypeNameHierarchy().getFullName() + " -> " + templateArgumentTypeNameHierarchy.getFullName(), defaultArgumentType.location) + addLocationSuffix(defaultArgumentTypeNameHierarchy.getQualifiedNameWithSignature() + " -> " + templateParameterNameHierarchy.getQualifiedName(), location) ); return 0; } - virtual Id onTemplateRecordParameterTypeParsed( - const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy, - const NameHierarchy& templateRecordNameHierarchy) + virtual Id onTemplateParameterTypeParsed( + const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy) { templateParameterTypes.push_back( - addLocationSuffix(templateParameterTypeNameHierarchy.getFullName(), location) + addLocationSuffix(templateParameterTypeNameHierarchy.getQualifiedName(), location) ); return 0; } - virtual Id onTemplateRecordSpecializationParsed( - const ParseLocation& location, const NameHierarchy& specializedRecordNameHierarchy, - const RecordType specializedRecordType, const NameHierarchy& specializedFromNameHierarchy) + virtual Id onTemplateSpecializationParsed( + const ParseLocation& location, const NameHierarchy& specializedNameHierarchy, + const NameHierarchy& specializedFromNameHierarchy) { templateSpecializations.push_back(addLocationSuffix( - std::string(specializedRecordType == ParserClient::RECORD_CLASS ? "class" : "struct") + " " + - specializedRecordNameHierarchy.getFullName() + " -> " + specializedFromNameHierarchy.getFullName(), location + specializedNameHierarchy.getQualifiedNameWithSignature() + " -> " + specializedFromNameHierarchy.getQualifiedNameWithSignature(), location )); return 0; } virtual Id onTemplateMemberFunctionSpecializationParsed( - const ParseLocation& location, const ParseFunction& instantiatedFunction, const ParseFunction& specializedFunction) + const ParseLocation& location, const NameHierarchy& instantiatedFunction, const NameHierarchy& specializedFunction) { templateMemberSpecializations.push_back(addLocationSuffix( - functionStr(instantiatedFunction) + " -> " + functionStr(specializedFunction), location + instantiatedFunction.getQualifiedNameWithSignature() + " -> " + specializedFunction.getQualifiedNameWithSignature(), location )); return 0; } - virtual Id onTemplateFunctionParameterTypeParsed( - const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy, - const ParseFunction function) - { - templateParameterTypes.push_back( - addLocationSuffix(templateParameterTypeNameHierarchy.getFullName(), location) // TODO: add template function! - ); - return 0; - } - - virtual Id onTemplateFunctionSpecializationParsed( - const ParseLocation& location, const ParseFunction specializedFunction, const ParseFunction templateFunction) - { - templateSpecializations.push_back( - addLocationSuffix(functionStr(specializedFunction) + " -> " + functionStr(templateFunction), location) - ); - return 0; - } - virtual Id onFileParsed(const FileInfo& fileInfo) { files.push_back(fileInfo.path.str()); @@ -3135,13 +2996,13 @@ private: virtual Id onMacroDefineParsed( const ParseLocation& location, const NameHierarchy& macroNameHierarchy, const ParseLocation& scopeLocation) { - macros.push_back(addLocationSuffix(macroNameHierarchy.getFullName(), location, scopeLocation)); + macros.push_back(addLocationSuffix(macroNameHierarchy.getQualifiedName(), location, scopeLocation)); return 0; } virtual Id onMacroExpandParsed(const ParseLocation& location, const NameHierarchy& macroNameHierarchy) { - macroUses.push_back(addLocationSuffix(macroNameHierarchy.getFullName() ,location)); + macroUses.push_back(addLocationSuffix(macroNameHierarchy.getQualifiedName() ,location)); return 0; } @@ -3182,25 +3043,6 @@ private: std::vector includes; std::vector comments; - - private: - void addTypeUse(const ParseTypeUsage& use) - { - if (use.location.isValid()) - { - typeUses.push_back(addLocationSuffix(use.dataType->getFullTypeName(), use.location)); - } - } - - void addTypeUse(const ParseTypeUsage& use, const ParseFunction& func) - { - if (use.location.isValid()) - { - typeUses.push_back( - addLocationSuffix(functionStr(func) + " -> " + use.dataType->getFullTypeName(), use.location) - ); - } - } }; std::shared_ptr parseCode(std::string code, bool logErrors = true) diff --git a/src/test/StorageTestSuite.h b/src/test/StorageTestSuite.h index 5a7c8026..1f58a14b 100644 --- a/src/test/StorageTestSuite.h +++ b/src/test/StorageTestSuite.h @@ -25,13 +25,11 @@ public: void test_storage_saves_typedef() { TestStorage storage; - Id id = storage.onTypedefParsed(validLocation(1), createNameHierarchy("type"), typeUsage("int"), ParserClient::ACCESS_NONE); + Id id = storage.onTypedefParsed(validLocation(1), createNameHierarchy("type"), ParserClient::ACCESS_NONE); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "type"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "type"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_TYPEDEF); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_TYPEDEF_OF, "type", "int") != 0); - std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); } @@ -41,7 +39,7 @@ public: TestStorage storage; Id id = storage.onClassParsed(validLocation(1), createNameHierarchy("Class"), ParserClient::ACCESS_NONE, validLocation(2)); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "Class"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "Class"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_CLASS); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); @@ -54,7 +52,7 @@ public: TestStorage storage; Id id = storage.onStructParsed(validLocation(1), createNameHierarchy("Struct"), ParserClient::ACCESS_NONE, validLocation(2)); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "Struct"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "Struct"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_STRUCT); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); @@ -65,29 +63,11 @@ public: void test_storage_saves_global_variable() { TestStorage storage; - Id id = storage.onGlobalVariableParsed(validLocation(42), ParseVariable(typeUsage("char"), createNameHierarchy("Global"), false)); + Id id = storage.onGlobalVariableParsed(validLocation(42), createNameHierarchy("Global")); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "Global"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "Global"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_GLOBAL_VARIABLE); - //TS_ASSERT(!node->getComponent()); - - TS_ASSERT(storage.getEdgeId(Edge::EDGE_TYPE_OF, "Global", "char") != 0); - - std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); - TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); - } - - void test_storage_saves_global_variable_static() - { - TestStorage storage; - Id id = storage.onGlobalVariableParsed(validLocation(7), ParseVariable(typeUsage("char"), createNameHierarchy("Global"), true)); - - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "Global"); - TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_GLOBAL_VARIABLE); - - //TS_ASSERT(node->getComponent()); - std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); } @@ -96,36 +76,28 @@ public: { TestStorage storage; Id id = storage.onFieldParsed( - validLocation(3), ParseVariable(typeUsage("bool"), createNameHierarchy("m_field"), false), ParserClient::ACCESS_NONE - ); - - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "m_field"); + validLocation(3), createNameHierarchy("m_field"), ParserClient::ACCESS_NONE); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "m_field"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_FIELD); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_TYPE_OF, "m_field", "bool") != 0); - std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); } void test_storage_saves_field_as_member() { + NameHierarchy a = createNameHierarchy("Struct::m_field"); + NameHierarchy b = createNameHierarchy("Struct"); + TestStorage storage; Id id = storage.onFieldParsed( - validLocation(11), ParseVariable(typeUsage("bool"), createNameHierarchy("Struct::m_field"), false), ParserClient::ACCESS_PUBLIC + validLocation(11), a, ParserClient::ACCESS_PUBLIC ); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "Struct::m_field"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "Struct::m_field"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_FIELD); - - TS_ASSERT(storage.getEdgeId(Edge::EDGE_MEMBER, "Struct", "Struct::m_field") != 0); - //TS_ASSERT(memberEdge->getComponent()); - //TS_ASSERT_EQUALS( - // memberEdge->getComponent()->getAccess(), TokenComponentAccess::ACCESS_PUBLIC - //); - - TS_ASSERT(storage.getEdgeId(Edge::EDGE_TYPE_OF, "Struct::m_field", "bool") != 0); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_MEMBER, b, a) != 0); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); @@ -135,17 +107,12 @@ public: { TestStorage storage; Id id = storage.onFunctionParsed( - validLocation(14), ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), parameters("char")), validLocation(41) + validLocation(14), createFunctionNameHierarchy("bool", "isTrue", "(char)"), validLocation(41) ); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "isTrue"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "bool isTrue(char)"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_FUNCTION); - // TS_ASSERT(storage.getEdgeId(Edge::EDGE_RETURN_TYPE_OF, "isTrue", "bool") != 0); - // TS_ASSERT(storage.getEdgeId(Edge::EDGE_PARAMETER_TYPE_OF, "isTrue", "char") != 0); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_TYPE_USAGE, "isTrue", "bool") != 0); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_TYPE_USAGE, "isTrue", "char") != 0); - std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 2); } @@ -155,20 +122,15 @@ public: TestStorage storage; Id id = storage.onMethodParsed( validLocation(9), - ParseFunction(typeUsage("void"), createNameHierarchy("isMethod"), parameters("bool")), + createFunctionNameHierarchy("void", "isMethod", "(bool)"), ParserClient::ACCESS_NONE, ParserClient::ABSTRACTION_NONE, validLocation(4) ); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "isMethod"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "void isMethod(bool)"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_METHOD); - // TS_ASSERT(storage.getEdgeId(Edge::EDGE_RETURN_TYPE_OF, "isMethod", "void") != 0); - // TS_ASSERT(storage.getEdgeId(Edge::EDGE_PARAMETER_TYPE_OF, "isMethod", "bool") != 0); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_TYPE_USAGE, "isMethod", "void") != 0); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_TYPE_USAGE, "isMethod", "bool") != 0); - std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 2); } @@ -186,33 +148,24 @@ public: //Node* node = storage.getNodeWithId(id); //TS_ASSERT(node); - //TS_ASSERT_EQUALS(node->getFullName(), "isMethod"); + //TS_ASSERT_EQUALS(node->getQualifiedNameWithSignature(), "isMethod"); //TS_ASSERT_EQUALS(node->getType(), Node::NODE_METHOD); //TS_ASSERT(node->getComponent()); } void test_storage_saves_method_as_member() { + NameHierarchy a = createFunctionNameHierarchy("void", "Class::isMethod", "(bool)"); TestStorage storage; storage.onMethodParsed( validLocation(1), - ParseFunction(typeUsage("void"), createNameHierarchy("Class::isMethod"), parameters("bool")), + a, ParserClient::ACCESS_PROTECTED, ParserClient::ABSTRACTION_VIRTUAL, validLocation(4) ); - //TS_ASSERT(node->getComponent()); - //TS_ASSERT_EQUALS( - // node->getComponent()->getAbstraction(), - // TokenComponentAbstraction::ABSTRACTION_VIRTUAL - //); - - TS_ASSERT(storage.getEdgeId(Edge::EDGE_MEMBER, "Class", "Class::isMethod") != 0); - //TS_ASSERT(memberEdge->getComponent()); - //TS_ASSERT_EQUALS( - // memberEdge->getComponent()->getAccess(), TokenComponentAccess::ACCESS_PROTECTED - //); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_MEMBER, createNameHierarchy("Class"), a) != 0); } void test_storage_saves_namespace() @@ -220,7 +173,7 @@ public: TestStorage storage; Id id = storage.onNamespaceParsed(validLocation(1), createNameHierarchy("utility"), validLocation(2)); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "utility"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "utility"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_NAMESPACE); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); @@ -233,7 +186,7 @@ public: TestStorage storage; Id id = storage.onEnumParsed(validLocation(17), createNameHierarchy("Category"), ParserClient::ACCESS_NONE, validLocation(23)); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "Category"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "Category"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_ENUM); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); @@ -243,18 +196,14 @@ public: void test_storage_saves_enum_as_member() { + NameHierarchy a = createNameHierarchy("Class::Category"); TestStorage storage; storage.onEnumParsed( - validLocation(1), createNameHierarchy("Class::Category"), + validLocation(1), a, ParserClient::ACCESS_PRIVATE, validLocation(2) ); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_MEMBER, "Class", "Class::Category") != 0); - - //TS_ASSERT(memberEdge->getComponent()); - //TS_ASSERT_EQUALS( - // memberEdge->getComponent()->getAccess(), TokenComponentAccess::ACCESS_PRIVATE - //); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_MEMBER, createNameHierarchy("Class"), a) != 0); } void test_storage_saves_enum_constant() @@ -262,7 +211,7 @@ public: TestStorage storage; Id id = storage.onEnumConstantParsed(validLocation(1), createNameHierarchy("VALUE")); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "VALUE"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "VALUE"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_ENUM_CONSTANT); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); @@ -279,7 +228,7 @@ public: createNameHierarchy("ClassA"), ParserClient::ACCESS_PUBLIC ); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_INHERITANCE, "ClassB", "ClassA") != 0); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_INHERITANCE, createNameHierarchy("ClassB"), createNameHierarchy("ClassA")) != 0); //TS_ASSERT(edge->getComponent()); //TS_ASSERT_EQUALS(edge->getComponent()->getAccess(), TokenComponentAccess::ACCESS_PUBLIC); @@ -297,7 +246,7 @@ public: createNameHierarchy("StructA"), ParserClient::ACCESS_PUBLIC ); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_INHERITANCE, "StructB", "StructA") != 0); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_INHERITANCE, createNameHierarchy("StructB"), createNameHierarchy("StructA")) != 0); //TS_ASSERT(edge->getComponent()); //TS_ASSERT_EQUALS(edge->getComponent()->getAccess(), TokenComponentAccess::ACCESS_PUBLIC); @@ -310,33 +259,47 @@ public: { TestStorage storage; - ParseFunction a(typeUsage("void"), createNameHierarchy("A::isMethod"), parameters("bool")); - ParseFunction b(typeUsage("void"), createNameHierarchy("B::isMethod"), parameters("bool")); + NameHierarchy a = createFunctionNameHierarchy("void", "A::isMethod", "(bool)"); + NameHierarchy b = createFunctionNameHierarchy("void", "B::isMethod", "(bool)"); - storage.onMethodParsed(validLocation(9), a, ParserClient::ACCESS_PRIVATE, ParserClient::ABSTRACTION_VIRTUAL, validLocation(4)); - storage.onMethodParsed(validLocation(7), b, ParserClient::ACCESS_PRIVATE, ParserClient::ABSTRACTION_NONE, validLocation(3)); + storage.onMethodParsed( + validLocation(9), + a, + ParserClient::ACCESS_PRIVATE, + ParserClient::ABSTRACTION_VIRTUAL, + validLocation(4)); + storage.onMethodParsed( + validLocation(7), + b, + ParserClient::ACCESS_PRIVATE, + ParserClient::ABSTRACTION_NONE, + validLocation(3)); storage.onMethodOverrideParsed(validLocation(4), a, b); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_OVERRIDE, "B::isMethod", "A::isMethod") != 0); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_OVERRIDE, b, a) != 0); } void test_storage_saves_call() { TestStorage storage; + + NameHierarchy a = createFunctionNameHierarchy("bool", "isTrue", "(char)"); + NameHierarchy b = createFunctionNameHierarchy("void", "func", "(bool)"); + storage.onFunctionParsed( - validLocation(), ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), parameters("char")), validLocation() + validLocation(), a, validLocation() ); storage.onFunctionParsed( - validLocation(), ParseFunction(typeUsage("void"), createNameHierarchy("func"), parameters("bool")), validLocation() + validLocation(), b, validLocation() ); Id id = storage.onCallParsed( validLocation(9), - ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), parameters("char")), - ParseFunction(typeUsage("void"), createNameHierarchy("func"), parameters("bool")) + a, + b ); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_CALL, "isTrue", "func") != 0); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_CALL, a, b) != 0); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); @@ -344,19 +307,22 @@ public: void test_storage_saves_call_in_global_variable_declaration() { + TestStorage storage; - storage.onGlobalVariableParsed(validLocation(), ParseVariable(typeUsage("bool"), createNameHierarchy("global"), false)); + storage.onGlobalVariableParsed(validLocation(), createNameHierarchy("global")); + + NameHierarchy a = createFunctionNameHierarchy("bool", "isTrue", "(char)"); storage.onFunctionParsed( - validLocation(), ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), parameters("char")), validLocation() + validLocation(), a, validLocation() ); Id id = storage.onCallParsed( validLocation(7), - ParseVariable(typeUsage("bool"), createNameHierarchy("global"), false), - ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), parameters("char")) + createNameHierarchy("global"), + a ); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_CALL, "global", "isTrue") != 0); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_CALL, createNameHierarchy("global"), a) != 0); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); @@ -364,21 +330,23 @@ public: void test_storage_saves_field_usage() { + NameHierarchy a = createFunctionNameHierarchy("bool", "isTrue", "(char)"); + TestStorage storage; storage.onFunctionParsed( - validLocation(), ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), parameters("char")), validLocation() + validLocation(), a, validLocation() ); storage.onFieldParsed( - validLocation(), ParseVariable(typeUsage("bool"), createNameHierarchy("Foo::m_field"), false), ParserClient::ACCESS_PRIVATE + validLocation(), createNameHierarchy("Foo::m_field"), ParserClient::ACCESS_PRIVATE ); Id id = storage.onFieldUsageParsed( validLocation(7), - ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), parameters("char")), + a, createNameHierarchy("Foo::m_field") ); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_USAGE, "isTrue", "Foo::m_field") != 0); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_USAGE, a, createNameHierarchy("Foo::m_field")) != 0); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); @@ -386,19 +354,21 @@ public: void test_storage_saves_global_variable_usage() { + NameHierarchy a = createFunctionNameHierarchy("bool", "isTrue", "(char)"); + TestStorage storage; storage.onFunctionParsed( - validLocation(), ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), parameters("char")), validLocation() + validLocation(), a, validLocation() ); - storage.onGlobalVariableParsed(validLocation(), ParseVariable(typeUsage("bool"), createNameHierarchy("global"), false)); + storage.onGlobalVariableParsed(validLocation(), createNameHierarchy("global")); Id id = storage.onGlobalVariableUsageParsed( validLocation(7), - ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), parameters("char")), + a, createNameHierarchy("global") ); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_USAGE, "isTrue", "global") != 0); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_USAGE, a, createNameHierarchy("global")) != 0); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); @@ -406,20 +376,19 @@ public: void test_storage_saves_type_usage() { + NameHierarchy a = createFunctionNameHierarchy("Struct", "isTrue", "(char)"); TestStorage storage; storage.onFunctionParsed( - validLocation(), ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), - parameters("char")), validLocation() + validLocation(), a, validLocation() ); storage.onStructParsed( validLocation(), createNameHierarchy("Struct"), ParserClient::ACCESS_NONE, validLocation()); Id id = storage.onTypeUsageParsed( - typeUsage("Struct"), - ParseFunction(typeUsage("bool"), createNameHierarchy("isTrue"), parameters("char")) + validLocation(7), a, createNameHierarchy("Struct") ); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_TYPE_USAGE, "isTrue", "Struct") != 0); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_TYPE_USAGE, a, createNameHierarchy("Struct")) != 0); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); @@ -548,7 +517,7 @@ public: Id id = storage.onFileParsed(FileInfo("file.h")); - TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getFullName(), "file.h"); + TS_ASSERT_EQUALS(storage.getNameHierarchyForNodeWithId(id).getQualifiedNameWithSignature(), "file.h"); TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_FILE); } @@ -560,7 +529,7 @@ public: storage.onFileParsed(FileInfo("file.cpp")); Id id = storage.onFileIncludeParsed(validLocation(7), FileInfo("file.cpp"), FileInfo("file.h")); - TS_ASSERT(storage.getEdgeId(Edge::EDGE_INCLUDE, "file.cpp", "file.h") != 0); + TS_ASSERT(storage.getEdgeId(Edge::EDGE_INCLUDE, createNameHierarchy("file.cpp"), createNameHierarchy("file.h")) != 0); std::shared_ptr tlc = storage.getLocationCollectionForTokenId(id); TS_ASSERT_EQUALS(tlc->getTokenLocationCount(), 1); @@ -576,8 +545,8 @@ public: //Id id4 = storage.onFileIncludeParsed(validLocation(), "file.h", "f.h"); //Id id5 = storage.onFileIncludeParsed(validLocation(), "file.cpp", "file.h"); - //std::string name1 = storage.getNodeWithId(id2)->getFullName(); - //std::string name2 = storage.getNodeWithId(id3)->getFullName(); + //std::string name1 = storage.getNodeWithId(id2)->getQualifiedNameWithSignature(); + //std::string name2 = storage.getNodeWithId(id3)->getQualifiedNameWithSignature(); //std::set filePaths; //filePaths.insert(FilePath(name1)); @@ -632,22 +601,11 @@ private: return getSearchIndex(); } - NameHierarchy nameHierarchyFromString(const std::string& str) const - { - NameHierarchy result; - std::vector names = utility::splitToVector(str, "::"); - for (const std::string& name : names) - { - result.push(std::make_shared(name)); - } - return result; - } - - Id getEdgeId(Edge::EdgeType type, const std::string& fromName, const std::string& toName) const + Id getEdgeId(Edge::EdgeType type, const NameHierarchy& fromName, const NameHierarchy& toName) const { NameHierarchy from; - return getIdForEdge(type, nameHierarchyFromString(fromName), nameHierarchyFromString(toName)); + return getIdForEdge(type, fromName, toName); } }; @@ -664,28 +622,24 @@ private: location->getColumnNumber() == locationId; } + NameHierarchy createFunctionNameHierarchy(std::string ret, std::string name, std::string parameters) const + { + NameHierarchy nameHierarchy = createNameHierarchy(name); + std::string lastName = nameHierarchy.back()->getName(); + nameHierarchy.pop(); + nameHierarchy.push(std::make_shared(lastName, NameElement::Signature(ret, parameters))); + return nameHierarchy; + } + NameHierarchy createNameHierarchy(std::string s) const { NameHierarchy nameHierarchy; for (std::string element: utility::splitToVector(s, "::")) { - std::string signature = (element.find("(") != element.npos ? element : ""); - nameHierarchy.push(std::make_shared(element, signature)); + nameHierarchy.push(std::make_shared(element, NameElement::Signature())); } return nameHierarchy; } - ParseTypeUsage typeUsage(const std::string& typeName) const - { - return ParseTypeUsage(validLocation(), std::make_shared(createNameHierarchy(typeName))); - } - - std::vector parameters(const std::string& param) const - { - std::vector params; - params.push_back(typeUsage(param)); - return params; - } - std::string m_filePath; };