How are keywords developed?

Has Dr James Gosling written code for Java keywords?

Yes, when he wrote the first Java compiler he probably wrote code to handle compilation of keywords.

How to view Java keywords code like we view source code?

There is no "Java method" behind while or if etc. These are language primitives handled specially by the compiler.

Is there any way to create user defined keyword?

No, you can't create user defined keywords. The semantics of the keywords are specified in the Java Language Specification and treated specially by the compiler.

There is no Java keyword code. Java complier holds list of keywords, which helps the complier to understand code.

Yes. That's pretty much it.

Source: I'm a javac developer


Usually the process of writing a software able to turning a language in something else is done by "compiler of compilers" tools by specifying a grammar, typically a BNF form is used. The first usable version of the language are in many case used to create the compiler itself, in order to prove the language effectiveness. If you want to extend java by changing the keywords and adding different ones, you should create a new language, maybe starting from the Java Grammar itself.