1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * See LICENSE.txt included in this distribution for the specific 9 * language governing permissions and limitations under the License. 10 * 11 * When distributing Covered Code, include this CDDL HEADER in each 12 * file and include the License file at LICENSE.txt. 13 * If applicable, add the following below this CDDL HEADER, with the 14 * fields enclosed by brackets "[]" replaced with your own identifying 15 * information: Portions Copyright [yyyy] [name of copyright owner] 16 * 17 * CDDL HEADER END 18 */ 19 20 /* 21 * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. 22 * Portions Copyright (c) 2017, Chris Fraire <cfraire@me.com>. 23 */ 24 package org.opengrok.indexer.analysis.erlang; 25 26 import java.util.HashSet; 27 import java.util.Set; 28 29 /** 30 * Holds static hash set containing the Erlang keywords. 31 */ 32 public class Consts { 33 34 static final Set<String> kwd = new HashSet<>(); 35 static final Set<String> modules_kwd = new HashSet<>(); 36 static { 37 kwd.add("after"); // Ref. 9.1 "1.5 Reserved Words" 38 kwd.add("and"); // Ref. 9.1 "1.5 Reserved Words" 39 kwd.add("andalso"); // Ref. 9.1 "1.5 Reserved Words" 40 kwd.add("band"); // Ref. 9.1 "1.5 Reserved Words" 41 kwd.add("begin"); // Ref. 9.1 "1.5 Reserved Words" 42 kwd.add("bnot"); // Ref. 9.1 "1.5 Reserved Words" 43 kwd.add("bor"); // Ref. 9.1 "1.5 Reserved Words" 44 kwd.add("bsl"); // Ref. 9.1 "1.5 Reserved Words" 45 kwd.add("bsr"); // Ref. 9.1 "1.5 Reserved Words" 46 kwd.add("bxor"); // Ref. 9.1 "1.5 Reserved Words" 47 kwd.add("case"); // Ref. 9.1 "1.5 Reserved Words" 48 kwd.add("catch"); // Ref. 9.1 "1.5 Reserved Words" 49 kwd.add("cond"); // Ref. 9.1 "1.5 Reserved Words" 50 kwd.add("div"); // Ref. 9.1 "1.5 Reserved Words" 51 kwd.add("end"); // Ref. 9.1 "1.5 Reserved Words" 52 kwd.add("fun"); // Ref. 9.1 "1.5 Reserved Words" 53 kwd.add("if"); // Ref. 9.1 "1.5 Reserved Words" 54 kwd.add("let"); // Ref. 9.1 "1.5 Reserved Words" 55 kwd.add("not"); // Ref. 9.1 "1.5 Reserved Words" 56 kwd.add("of"); // Ref. 9.1 "1.5 Reserved Words" 57 kwd.add("or"); // Ref. 9.1 "1.5 Reserved Words" 58 kwd.add("orelse"); // Ref. 9.1 "1.5 Reserved Words" 59 kwd.add("receive"); // Ref. 9.1 "1.5 Reserved Words" 60 kwd.add("rem"); // Ref. 9.1 "1.5 Reserved Words" 61 kwd.add("try"); // Ref. 9.1 "1.5 Reserved Words" 62 kwd.add("when"); // Ref. 9.1 "1.5 Reserved Words" 63 kwd.add("xor"); // Ref. 9.1 "1.5 Reserved Words" 64 65 kwd.add("query"); // pre-existing here of unknown provenance 66 67 modules_kwd.add("behavior"); // Ref. 9.1 "5.2 Module Attributes" 68 modules_kwd.add("behaviour"); // Ref. 9.1 "5.2 Module Attributes" 69 modules_kwd.add("callback"); // Ref. 9.1 "5.2 Module Attributes" 70 modules_kwd.add("compile"); // Ref. 9.1 "5.2 Module Attributes" 71 modules_kwd.add("define"); // Ref. 9.1 "5.2 Module Attributes" 72 modules_kwd.add("export"); // Ref. 9.1 "5.2 Module Attributes" 73 modules_kwd.add("file"); // Ref. 9.1 "5.2 Module Attributes" 74 modules_kwd.add("import"); // Ref. 9.1 "5.2 Module Attributes" 75 modules_kwd.add("include"); // Ref. 9.1 "5.2 Module Attributes" 76 modules_kwd.add("module"); // Ref. 9.1 "5.2 Module Attributes" 77 modules_kwd.add("on_load"); // Ref. 9.1 "5.2 Module Attributes" 78 modules_kwd.add("record"); // Ref. 9.1 "5.2 Module Attributes" 79 modules_kwd.add("spec"); // Ref. 9.1 "5.2 Module Attributes" 80 modules_kwd.add("type"); // Ref. 9.1 "5.2 Module Attributes" 81 modules_kwd.add("vsn"); // Ref. 9.1 "5.2 Module Attributes" 82 } 83 Consts()84 private Consts() { 85 } 86 87 } 88