How to get original parameter type and not an expanded typedef
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Empieza examinando cómo las opciones del parser, especialmente AutoSquashTypedef, afectan a los tipos de los parámetros, y compara la salida de la biblioteca con la interfaz C de Clang y el comportamiento de los tipos canónicos. El cambio tendría que conservar la escritura original del typedef y los argumentos de plantilla para los tres parámetros de método de ejemplo, manteniendo al mismo tiempo el acceso a sus tipos expandidos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Let's say I have the following code
template<class T>
class MyTemplateClass
{
....
};
typedef unsigned int MyInt;
typedef ::MyTemplateClass<char> MyCharClass;
typedef ::MyTemplateClass<::MyInt> MyMyIntClass;
class MyTestClass
{
void TestMethod1(::MyInt param);
void TestMethod2(::MyCharClass& param);
void TestMethod3(::MyMyIntClass& param);
};
When I parse this, I get the following parameter information for the methods:
TestMethod1 -> param type is unsigned int
TestMethod2 -> param type is MyTemplateClass (wihtout the template arguments!)
TestMethod3 -> param type is MyTemplateClass (wihtout the template arguments!)
When I look at the C interface of clang, it seems that this is solved by using the canonical types, where the original (non-expanded type) is the actual type and holds a pointer to the underlying expanded type (not tested as I am writing C# code using this library).
However using this library, I am not able to get the original type as it is declared in the method signature.
I would like to know the original parameter type as it is written in the code and not the already expanded typedef. My parse configuration is as follows:
new CppParserOptions
{
AutoSquashTypedef = false,
ParseAsCpp = true,
ParseAttributes = false,
ParseComments = false,
ParseMacros = true,
ParseSystemIncludes = false,
TargetCpu = CppTargetCpu.X86,
TargetSystem = @"windows",
TargetVendor = @"pc"
};
- Lenguaje dominante
- C#
- Estrellas
- 625
- Forks
- 79
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de xoofx/CppAst.NET
-
CppContainerList throws "The item belongs already to a container" when parsing VTK 9.5 headers BodyAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
xoofx/CppAst.NET#122 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
xoofx/CppAst.NET#117 ·
-
Parsing .cpp implementation?Abiertoquestion
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
xoofx/CppAst.NET#115 · 3 comentarios ·
-
question
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
xoofx/CppAst.NET#95 · 4 comentarios ·
-
NullReferenceException when parsing instantiation of a previously partially specialised templateAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
xoofx/CppAst.NET#77 · 6 comentarios ·
Todos los issues de xoofx/CppAst.NET
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 3 días
-
enhancement P3 performance
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
thomhurst/TUnit#7380 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
documentation trivial
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
PCL-Community/PCL-CE#3767 ·
Los mantenedores suelen responder en 1 día