corba/src/share/classes/com/sun/tools/corba/se/idl/Parser.java
changeset 2664 a0a22a8f16bd
parent 4 02bb8761fcce
child 3291 805a72a26925
equal deleted inserted replaced
2553:a8134c4ee2cf 2664:a0a22a8f16bd
     1 /*
     1 /*
     2  * Copyright 1999-2004 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Sun designates this
     7  * published by the Free Software Foundation.  Sun designates this
  2084     match (Token.Identifier);
  2084     match (Token.Identifier);
  2085     StructEntry structEntry = null ;
  2085     StructEntry structEntry = null ;
  2086 
  2086 
  2087     if (token.type == Token.LeftBrace) {
  2087     if (token.type == Token.LeftBrace) {
  2088       repIDStack.push(((IDLID)repIDStack.peek ()).clone ()) ;
  2088       repIDStack.push(((IDLID)repIDStack.peek ()).clone ()) ;
       
  2089       structEntry = makeStructEntry( name, entry, false ) ;
  2089       ((IDLID)repIDStack.peek ()).appendToName (name);
  2090       ((IDLID)repIDStack.peek ()).appendToName (name);
  2090       structEntry = makeStructEntry( name, entry, false ) ;
       
  2091       prep.openScope (structEntry);
  2091       prep.openScope (structEntry);
  2092       match (Token.LeftBrace) ;
  2092       match (Token.LeftBrace) ;
  2093       member (structEntry) ;
  2093       member (structEntry) ;
  2094       memberList2 (structEntry) ;
  2094       memberList2 (structEntry) ;
  2095       prep.closeScope (structEntry);
  2095       prep.closeScope (structEntry);
  2172     match (Token.Identifier) ;
  2172     match (Token.Identifier) ;
  2173     UnionEntry unionEntry = null ;
  2173     UnionEntry unionEntry = null ;
  2174 
  2174 
  2175     if (token.type == Token.Switch) {
  2175     if (token.type == Token.Switch) {
  2176       repIDStack.push (((IDLID)repIDStack.peek ()).clone ());
  2176       repIDStack.push (((IDLID)repIDStack.peek ()).clone ());
       
  2177       unionEntry = makeUnionEntry( name, entry, false ) ;
  2177       ((IDLID)repIDStack.peek ()).appendToName (name);
  2178       ((IDLID)repIDStack.peek ()).appendToName (name);
  2178       unionEntry = makeUnionEntry( name, entry, false ) ;
       
  2179       match (Token.Switch);
  2179       match (Token.Switch);
  2180       match (Token.LeftParen);
  2180       match (Token.LeftParen);
  2181       unionEntry.type (switchTypeSpec (unionEntry));
  2181       unionEntry.type (switchTypeSpec (unionEntry));
  2182       match (Token.RightParen);
  2182       match (Token.RightParen);
  2183       prep.openScope (unionEntry);
  2183       prep.openScope (unionEntry);
  2639    *
  2639    *
  2640    **/
  2640    **/
  2641   private void exceptDcl (SymtabEntry entry) throws IOException, ParseException
  2641   private void exceptDcl (SymtabEntry entry) throws IOException, ParseException
  2642   {
  2642   {
  2643     match (Token.Exception);
  2643     match (Token.Exception);
       
  2644     repIDStack.push (((IDLID)repIDStack.peek ()).clone ());
  2644     ExceptionEntry exceptEntry = stFactory.exceptionEntry (entry, (IDLID)repIDStack.peek ());
  2645     ExceptionEntry exceptEntry = stFactory.exceptionEntry (entry, (IDLID)repIDStack.peek ());
  2645     repIDStack.push (((IDLID)repIDStack.peek ()).clone ());
       
  2646     ((IDLID)repIDStack.peek ()).appendToName (token.name);
  2646     ((IDLID)repIDStack.peek ()).appendToName (token.name);
  2647     exceptEntry.sourceFile (scanner.fileEntry ());
  2647     exceptEntry.sourceFile (scanner.fileEntry ());
  2648     // Comment must immediately precede "exception" keyword
  2648     // Comment must immediately precede "exception" keyword
  2649     exceptEntry.comment (tokenHistory.lookBack (1).comment);
  2649     exceptEntry.comment (tokenHistory.lookBack (1).comment);
  2650     exceptEntry.name (token.name);
  2650     exceptEntry.name (token.name);