com.google.caja.parser.js
Class RegexpLiteral
java.lang.Object
com.google.caja.parser.AbstractParseTreeNode
com.google.caja.parser.js.AbstractExpression
com.google.caja.parser.js.Literal
com.google.caja.parser.js.RegexpLiteral
- All Implemented Interfaces:
- Expression, JsonMLCompatible, MutableParseTreeNode, ParseTreeNode, MessagePart, Renderable, java.lang.Cloneable
public final class RegexpLiteral
- extends Literal
A regular expression literal like /foo/i
.
- Author:
- mikesamuel@gmail.com
Methods inherited from class com.google.caja.parser.AbstractParseTreeNode |
acceptPostOrder, acceptPreOrder, appendChild, children, childrenAs, childrenPart, clone, createMutation, equals, format, formatSelf, formatTree, formatTree, getAttributes, getComments, getFilePosition, hashCode, insertBefore, removeChild, replaceChild, setComments, setFilePosition, toString, toStringDeep, toStringDeep |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
value
private final RegexpLiteral.RegexpWrapper value
RegexpLiteral
@ParseTreeNode.ReflectiveCtor
public RegexpLiteral(FilePosition pos,
RegexpLiteral.RegexpWrapper value,
java.util.List<? extends ParseTreeNode> children)
- Parameters:
children
- unused. This ctor is provided for reflection.
RegexpLiteral
public RegexpLiteral(FilePosition pos,
RegexpLiteral.RegexpWrapper value)
RegexpLiteral
public RegexpLiteral(FilePosition pos,
java.lang.String value)
getValue
public RegexpLiteral.RegexpWrapper getValue()
- Specified by:
getValue
in interface ParseTreeNode
- Specified by:
getValue
in class Literal
- Returns:
- null or a value with subclass specific meaning which encapsulates
all parsed state separate from the children.
render
public void render(RenderContext rc)
- Description copied from interface:
Renderable
- Output the textual form to
r.getOut()
.
- Specified by:
render
in interface Renderable
- Overrides:
render
in class Literal
getValueInBooleanContext
public boolean getValueInBooleanContext()
- Specified by:
getValueInBooleanContext
in class Literal
areRegexpModifiersValid
public static boolean areRegexpModifiersValid(java.lang.String flags)
- Modifiers are the letters allowed to follow a regular expression literal.
Firefox does not recognize the "s" modifier, and no version of javascript
deals with the "x" or "e" modifiers, so this regex matches g, i, and m in
any order without duplicates.
typeOf
public java.lang.String typeOf()
- Description copied from interface:
Expression
null
or the result of applying the typeof
operator to
the result of this expression.
- Returns:
- if the expression yields a result with the same
typeof
in all environments in which it returns normally, then returns the
result of applying the typeof
operator to the result.
null
if the type cannot be determined.
This method is conservative, so it may return null where it is possible
to prove a bound.
toJsonML
public com.google.javascript.jscomp.jsonml.JsonML toJsonML()
- Description copied from interface:
JsonMLCompatible
- Creates a
JsonML representation of this AST.
Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0