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) 2005, 2021, Oracle and/or its affiliates. All rights reserved. 22 */ 23 package org.opengrok.indexer.analysis.asm; 24 25 import java.util.HashSet; 26 import java.util.Set; 27 28 /** 29 * Holds static hash set containing the C keywords (copying for use by Asm for 30 * now). 31 */ 32 public class Consts { 33 34 static final Set<String> kwd = new HashSet<>(); 35 36 static { 37 // CPP 38 kwd.add("ident"); 39 kwd.add("ifndef"); 40 kwd.add("defined"); 41 kwd.add("endif"); 42 kwd.add("include"); 43 kwd.add("define"); 44 kwd.add("ifdef"); 45 kwd.add("pragma"); 46 47 // C keywords 48 kwd.add("asm"); 49 kwd.add("auto"); 50 kwd.add("break"); 51 kwd.add("case"); 52 kwd.add("char"); 53 kwd.add("const"); 54 kwd.add("continue"); 55 kwd.add("default"); 56 kwd.add("do"); 57 kwd.add("double"); 58 kwd.add("else"); 59 kwd.add("enum"); 60 kwd.add("extern"); 61 kwd.add("float"); 62 kwd.add("for"); 63 kwd.add("goto"); 64 kwd.add("if"); 65 kwd.add("inline"); 66 kwd.add("int"); 67 kwd.add("long"); 68 kwd.add("register"); 69 kwd.add("restrict"); 70 kwd.add("return"); 71 kwd.add("short"); 72 kwd.add("signed"); 73 kwd.add("sizeof"); 74 kwd.add("static"); 75 kwd.add("struct"); 76 kwd.add("switch"); 77 kwd.add("typedef"); 78 kwd.add("union"); 79 kwd.add("unsigned"); 80 kwd.add("void"); 81 kwd.add("volatile"); 82 kwd.add("while"); 83 kwd.add("_Bool"); 84 kwd.add("_Complex"); 85 kwd.add("_Imaginary"); 86 // other keywords 87 kwd.add("bool"); 88 kwd.add("true"); 89 kwd.add("false"); 90 kwd.add("redeclared"); 91 } 92 Consts()93 private Consts() { 94 } 95 } 96