logic: add type information of variable decl to name hierarchy

* implemented this feature for both, CXX and Java
* adjusted tests to reflect these changes
* added NameElement and NameHierarchy to Java code
* created more specialized JavaDeclName classes: JavaFunctionDeclName and JavaVariableDeclName
* implemented recording static modifier for Java methods and variables

fortune cookie message = You will enjoy true success in whatever you do.
This commit is contained in:
malte_langkabel
2017-07-28 09:12:32 +02:00
parent 2e117c4b6d
commit 01b1e0d6f1
21 changed files with 526 additions and 135 deletions
@@ -0,0 +1,52 @@
package com.sourcetrail.name;
public class NameElement
{
private String m_name = "";
private String m_prefix = "";
private String m_postfix = "";
public NameElement(String name)
{
if (name != null) m_name = name;
}
public NameElement(String name, String prefix, String postfix)
{
if (name != null) m_name = name;
if (prefix != null) m_prefix = prefix;
if (postfix != null) m_postfix = postfix;
}
String getName()
{
return m_name;
}
String getNameWithSignature()
{
String nameWithSignature = m_name;
if (m_prefix.length() > 0 || m_postfix.length() > 0)
{
nameWithSignature = m_prefix;
if (!m_name.isEmpty())
{
if (!m_prefix.isEmpty())
{
nameWithSignature += " ";
}
nameWithSignature += m_name;
}
nameWithSignature += m_postfix;
}
return nameWithSignature;
}
String serialize()
{
return m_name + "\ts" + m_prefix + "\tp" + m_postfix;
}
}