[Lldb-commits] [lldb] [LLDB] Add AST node classes, functions, etc. for Data Inspection Lang… (PR #95738)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 9 03:20:12 PDT 2024


================
@@ -0,0 +1,43 @@
+(* LLDB Debug Expressions, a subset of C++ *)
+(* Insired by https://www.nongnu.org/hcb *)
+
+expression = cast_expression;
+
+cast_expression = unary_expression;
+
+unary_expression = postfix_expression
+                 | unary_operator cast_expression;
+
+unary_operator = "*" | "&" | "-" ;
+
+postfix_expression = primary_expression
+                   | postfix_expression "[" expression "]"
+                   | postfix_expression "." id_expression
+                   | postfix_expression "->" id_expression
+
+primary_expression = numeric_literal
+                   | boolean_literal
+                   | pointer_literal
+                   | id_expression
+                   | "this" ;
+
+nested_name_specifier = namespace_name '::'
+                      | nested_name_specifier identifier "::";
+
+namespace_name = identifier ;
+
+id_expression = unqualified_id
+              | qualified_id ;
+
+unqualified_id = identifier ;
+
+qualified_id = [nested_name_specifier] unqualified_id
+             | identifier ;
+
+identifier = ? clang::tok::identifier ? ;
+
+numeric_literal = ? clang::tok::numeric_constant ? ;
+
+boolean_literal = "true" | "false" ;
+
+pointer_literal = "nullptr" ;
----------------
labath wrote:

true/false/nullptr are also spelled differently in different languages, and I don't believe they're necessary for the basic "frame variable" implementation. Can we skip those for now?

https://github.com/llvm/llvm-project/pull/95738


More information about the lldb-commits mailing list