|
1 | 1 | /***************************************************************************** |
2 | 2 | * SysML 2 Pilot Implementation |
3 | | - * Copyright (c) 2019, 2020, 2022, 2024 Model Driven Solutions, Inc. |
| 3 | + * Copyright (c) 2019, 2020, 2022, 2024, 2025 Model Driven Solutions, Inc. |
4 | 4 | * Copyright (c) 2023 Mgnite Inc. |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
@@ -122,13 +122,29 @@ public static boolean isIdentifier(String name) { |
122 | 122 | return name.matches("[a-zA-Z_]\\w*"); |
123 | 123 | } |
124 | 124 |
|
| 125 | + // Specific string used to identify a segment as a global scope qualifier |
| 126 | + public static final String GLOBAL_SCOPE_SYMBOL = "$"; |
| 127 | + |
| 128 | + public static boolean isGlobalScopeSymbol(String segment) { |
| 129 | + return segment == GLOBAL_SCOPE_SYMBOL; |
| 130 | + } |
| 131 | + |
125 | 132 | public static List<String> parseQualifiedName(String qualifiedNameText) { |
126 | 133 | List<String> segments = new ArrayList<>(); |
127 | 134 | int i = 0; |
128 | 135 | int j = 0; |
129 | 136 | int n = qualifiedNameText.length(); |
130 | 137 | boolean isDelimitable = true; |
131 | 138 |
|
| 139 | + |
| 140 | + if (qualifiedNameText.startsWith(GLOBAL_SCOPE_SYMBOL)) { |
| 141 | + // Add the specific GLOBAL_SCOPE_SYMBOL string to identify |
| 142 | + // a global scope qualifier segment. |
| 143 | + segments.add(GLOBAL_SCOPE_SYMBOL); |
| 144 | + i = 3; |
| 145 | + j = 3; |
| 146 | + } |
| 147 | + |
132 | 148 | while (j < n) { |
133 | 149 | char c = qualifiedNameText.charAt(j); |
134 | 150 | int delim = "\'\\:".indexOf(c); |
|
0 commit comments