1 package org.simantics.scl.compiler.common.names;
3 import java.io.StringReader;
5 import org.simantics.scl.compiler.internal.parsing.Token;
6 import org.simantics.scl.compiler.internal.parsing.parser.SCLLexer;
7 import org.simantics.scl.compiler.internal.parsing.parser.SCLTerminals;
9 import gnu.trove.set.hash.THashSet;
11 public class SCLReservedWords {
12 public static final String[] RESERVED_WORDS_ARRAY = {
49 public static final THashSet<String> RESERVED_WORDS_SET = new THashSet<>();
52 for(String word : RESERVED_WORDS_ARRAY)
53 RESERVED_WORDS_SET.add(word);
56 public static boolean isReserved(String str) {
58 SCLLexer lexer = new SCLLexer(new StringReader(str));
59 Token token = lexer.nextToken();
60 return token.id != SCLTerminals.ID;
61 } catch(Exception e) {