Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
clangml
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
memcad
clangml
Commits
8e22a03c
Commit
8e22a03c
authored
6 years ago
by
Thierry Martinez
Browse files
Options
Downloads
Patches
Plain Diff
bootstrapped repository for commit
d90ecf49
parent
005d9b92
Branches
Branches containing commit
Tags
4.0.0
Tags containing commit
No related merge requests found
Pipeline
#340458
failed
3 years ago
Stage: test
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+3
-0
3 additions, 0 deletions
README.md
clangml/clang.ml
+2
-2
2 additions, 2 deletions
clangml/clang.ml
clangml/clang__ast.ml
+6
-6
6 additions, 6 deletions
clangml/clang__ast.ml
printer/clangml_printer.ml
+2
-2
2 additions, 2 deletions
printer/clangml_printer.ml
with
13 additions
and
10 deletions
README.md
+
3
−
0
View file @
8e22a03c
...
...
@@ -106,9 +106,12 @@ which declares the algebraic data types that represent the AST.
The documentation of most of the nodes contains examples that can be used as references
for how syntactic constructions are parsed, and that are extracted with
[
ocamlcodoc
][
20
]
and serve as unit tests with
`dune runtest`
(or, equivalently,
`make tests`
).
Moreover, the git branch [
`norms`
] contains the AST corresponding to the examples
automatically extracted from C++14 and C++17 norms.
[
19
]:
https://memcad.gitlabpages.inria.fr/clangml/doc/clangml/Clang__ast/index.html
[
20
]:
https://gitlab.inria.fr/memcad/ocamlcodoc
[
`norms`
]:
https://gitlab.inria.fr/memcad/clangml/tree/norms/norms
Modules
[
`Clang.Type`
][
7
]
,
[
`Clang.Expr`
][
8
]
,
[
`Clang.Stmt`
][
9
]
,
[
`Clang.Decl`
][
10
]
and
[
`Clang.Enum_constant`
][
11
]
provides sub-modules
...
...
This diff is collapsed.
Click to expand it.
clangml/clang.ml
+
2
−
2
View file @
8e22a03c
...
...
@@ -198,10 +198,10 @@ module Ast = struct
Some
(
NestedIdentifier
ident
)
|
Namespace
->
let
decl
=
ext_nested_name_specifier_get_as_namespace
name
in
Some
(
Namespace
(
get_cursor_spelling
decl
))
Some
(
Namespace
Name
(
get_cursor_spelling
decl
))
|
NamespaceAlias
->
let
decl
=
ext_nested_name_specifier_get_as_namespace
name
in
Some
(
NamespaceAlias
(
get_cursor_spelling
decl
))
Some
(
NamespaceAlias
Name
(
get_cursor_spelling
decl
))
|
TypeSpec
->
let
ty
=
ext_nested_name_specifier_get_as_type
name
in
Some
(
TypeSpec
(
ty
|>
of_cxtype
))
...
...
This diff is collapsed.
Click to expand it.
clangml/clang__ast.ml
+
6
−
6
View file @
8e22a03c
...
...
@@ -683,8 +683,8 @@ and nested_name_specifier = nested_name_specifier_component list
and nested_name_specifier_component =
| Global
| NestedIdentifier of string
| Namespace of string
| NamespaceAlias of string
| Namespace
Name
of string
| NamespaceAlias
Name
of string
| TypeSpec of qual_type
| TypeSpecWithTemplate of qual_type
...
...
@@ -696,7 +696,7 @@ and declaration_name =
| DeductionGuideName of decl
| OperatorName of overloaded_operator_kind
| LiteralOperatorName of string
| UsingDirective
| UsingDirective
Name
and record_decl = {
keyword : elaborated_type_keyword;
...
...
@@ -3019,7 +3019,7 @@ let () =
check_pattern quote_decl_list (parse_declaration_list ~language:CXX) example
[%pattern?
[_; { desc = UsingDeclaration {
nested_name_specifier = Some [Namespace "std"];
nested_name_specifier = Some [Namespace
Name
"std"];
name = IdentifierName "cout" }}]]
]}*)
| Constructor of {
...
...
@@ -3381,8 +3381,8 @@ let () =
{ desc = Return (Some { desc = Call {
callee = { desc = DeclRef ({
nested_name_specifier = Some [
Namespace "ns1";
Namespace "ns2";];
Namespace
Name
"ns1";
Namespace
Name
"ns2";];
name = IdentifierName "f"})};
args = []; }})}] }}}] -> ()
| _ -> assert false
...
...
This diff is collapsed.
Click to expand it.
printer/clangml_printer.ml
+
2
−
2
View file @
8e22a03c
...
...
@@ -285,8 +285,8 @@ and print_ident_ref fmt ident_ref =
match
component
with
|
Global
->
Format
.
pp_print_string
fmt
"::"
|
NestedIdentifier
s
->
Format
.
fprintf
fmt
"%s::"
s
|
Namespace
name
|
NamespaceAlias
name
->
|
Namespace
Name
name
|
NamespaceAlias
Name
name
->
Format
.
fprintf
fmt
"%s::"
name
|
TypeSpec
ty
|
TypeSpecWithTemplate
ty
->
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment