Package org.antlr.codegen
Class RubyTarget.RubyRenderer
java.lang.Object
org.antlr.codegen.RubyTarget.RubyRenderer
- All Implemented Interfaces:
org.stringtemplate.v4.AttributeRenderer
- Enclosing class:
RubyTarget
public class RubyTarget.RubyRenderer
extends Object
implements org.stringtemplate.v4.AttributeRenderer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
private String
constantcase
(String value) private String
constantPath
(String value) private String
private String
private String
private String
rubyString
(String value) private String
given an input string, which is presumed to contain a word, which may potentially be camelcased, and convert it to snake_case underscore style.private String
subcamelcase
(String value) private String
-
Field Details
-
rubyCharValueEscape
-
-
Constructor Details
-
RubyRenderer
public RubyRenderer()
-
-
Method Details
-
toString
- Specified by:
toString
in interfaceorg.stringtemplate.v4.AttributeRenderer
-
snakecase
given an input string, which is presumed to contain a word, which may potentially be camelcased, and convert it to snake_case underscore style. algorithm -- iterate through the string with a sliding window 3 chars wide example -- aGUIWhatNot c c+1 c+2 action a G << 'a' << '_' // a lower-upper word edge G U I << 'g' U I W << 'w' I W h << 'i' << '_' // the last character in an acronym run of uppers W h << 'w' ... and so on -
constantcase
-
platform
-
symbol
-
lexerRule
-
constantPath
-
rubyString
-
camelcase
-
label
-
subcamelcase
-