You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Milinda Lakmal Pathirage (JIRA)" <ji...@apache.org> on 2006/11/28 05:33:21 UTC

[jira] Updated: (AXIS2-1778) org.apache.axis2.wsdl.util.CUtils for C realted keyword checking

     [ http://issues.apache.org/jira/browse/AXIS2-1778?page=all ]

Milinda Lakmal Pathirage updated AXIS2-1778:
--------------------------------------------

    Attachment: cutils_mod.patch

> org.apache.axis2.wsdl.util.CUtils for C realted keyword checking
> ----------------------------------------------------------------
>
>                 Key: AXIS2-1778
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1778
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: New Feature
>          Components: codegen
>    Affects Versions: nightly
>            Reporter: Milinda Lakmal Pathirage
>         Attachments: cutils_mod.patch
>
>
> This class is introduced to add methods to check C language specific key words.
> package org.apache.axis2.wsdl.util;
> import java.util.Arrays;
> import java.util.Locale;
> import java.text.Collator;
> public class CUtils {
>     static final String keywords[] =
>             {
>                     "auto", "double", "int", "struct",
>                     "break", "else", "long", "switch",
>                     "case", "enum", "register", "typedef",
>                     "char", "extern", "return", "union",
>                     "const", "float", "short", "unsigned",
>                     "continue", "for", "signed", "void",
>                     "default", "goto", "sizeof", "volatile",
>                     "do", "if", "static", "while"
>             };
>     /**
>      * Collator for comparing the strings
>      */
>     static final Collator englishCollator = Collator.getInstance(Locale.ENGLISH);
>     /**
>      * Use this character as suffix
>      */
>     static final char keywordPrefix = '_';
>     /**
>      * Checks if the input string is a valid C keyword.
>      *
>      * @return Returns boolean.
>      */
>     public static boolean isCKeyword(String keyword) {
>         return (Arrays.binarySearch(keywords, keyword, englishCollator) >= 0);
>     }
>     /**
>      * Turns a C keyword string into a non-C keyword string.  (Right now
>      * this simply means appending an underscore.)
>      */
>     public static String makeNonCKeyword(String keyword) {
>         return keywordPrefix + keyword;
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org