Returns the corresponding value for a given literal.

@param literalContext literal context
@return parsed value
179148
private Object getPropertyValue(GDLParser.LiteralContext literalContext) {
    String text;
    if (literalContext.StringLiteral() != null) {
      return parseString(literalContext.StringLiteral().getText());
    } else if (literalContext.BooleanLiteral() != null) {
      return Boolean.parseBoolean(literalContext.BooleanLiteral().getText());
    } else if (literalContext.IntegerLiteral() != null) {
      text = literalContext.IntegerLiteral().getText().toLowerCase();
      if (text.endsWith("l")) {
        return Long.parseLong(text.substring(0, text.length() - 1));
      }
      return Integer.parseInt(text);
    } else if (literalContext.FloatingPointLiteral() != null) {
      text = literalContext.FloatingPointLiteral().getText().toLowerCase();
      if (text.endsWith("f")) {
        return Float.parseFloat(text.substring(0, text.length() - 1));
      } else if (text.endsWith("d")) {
        return Double.parseDouble(text.substring(0, text.length() - 1));
      }
      return Float.parseFloat(text);
    }
    return null;
  }
595524
public String getStringValue(FacesContext context) {
        String result = null;
        if (hasValueExpression()) {
            result = getStringValueFromModel(context);
        } else {
            result = (null != rawValue) ? rawValue : (String) getValue();
        }
        return result;
    }
1158415
public static LiteralType parse(String input) {
		LiteralType result=new LiteralType();
		parse(result, input);
		
		return result;
	}
917474
public Object get(Object key) {
    Object result = null;

    if(wrappedBindings.containsKey(key)) {
      result = wrappedBindings.get(key);
    }
    else {
      if (key instanceof String) {
        TypedValue resolvedValue = variableContext.resolve((String) key);
        result = unpack(resolvedValue);
      }
    }

    return result;
  }
1193887
final public void Literal() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case TRUE:
    case FALSE:
      Boolean();
      break;
    case FLOATING_POINT_LITERAL:
      FloatingPoint();
      break;
    case INTEGER_LITERAL:
      Integer();
      break;
    case STRING_LITERAL:
      String();
      break;
    case NULL:
      Null();
      break;
    default:
      jj_la1[50] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }
809714
public static TagContext getValue(Context context) {
    @javax.annotation.Nullable TagContext tags = TAG_CONTEXT_KEY.get(context);
    return tags == null ? EMPTY_TAG_CONTEXT : tags;
  }
359687
function () {
      var e = {
        type: 'literal',
        value: this.value.toString()
      };
      if (this.lang !== undefined) {
        e.lang = this.lang;
      } else if (this.datatype !== undefined) {
        e.datatype = this.datatype.toString();
      }
      return e;
    }
1267407
protected void Literal() throws javax.xml.transform.TransformerException
  {

    int last = m_token.length() - 1;
    char c0 = m_tokenChar;
    char cX = m_token.charAt(last);

    if (((c0 == '\"') && (cX == '\"')) || ((c0 == '\'') && (cX == '\'')))
    {

      // Mutate the token to remove the quotes and have the XString object
      // already made.
      int tokenQueuePos = m_queueMark - 1;

      m_ops.m_tokenQueue.setElementAt(null,tokenQueuePos);

      Object obj = new XString(m_token.substring(1, last));

      m_ops.m_tokenQueue.setElementAt(obj,tokenQueuePos);

      // lit = m_token.substring(1, last);
      m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), tokenQueuePos);
      m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);

      nextToken();
    }
    else
    {
      error(XPATHErrorResources.ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
            new Object[]{ m_token });  //"Pattern literal ("+m_token+") needs to be quoted!");
    }
  }
1179479
@Override
    public Integer getValue(T context) {

        CalendarSystem<T> calsys = this.getCalendarSystem(context);
        T start = context.with(this.dayOfYear, 1);
        return toGregorianYear(calsys.transform(start));

    }
849314
protected Expression literal(int opPos)
  {

    opPos = getFirstChildPos(opPos);

    return (XString) getTokenQueue().elementAt(getOp(opPos));
  }
306483
@Override
	public String[] getContext(Sentence sent, int pos) {
	List<String> cps = new ArrayList<String>();
		
		for (int it = 0; it < cpnames.size(); ++it){			
			String cp = cpnames.get(it);
			Vector<Integer> paras = this.paras.get(it);
			String cpvalue = "";
			if (cp.equals("initial_cap")){
				cpvalue = ic(sent,pos,paras.get(0));
			}
			else if (cp.equals("all_cap")){
				cpvalue = ac(sent, pos, paras.get(0));
			}
			else if (cp.equals("mark")){
				cpvalue = mk(sent, pos, paras.get(0));
			}
			else if (cp.equals("first_obsrv")){
				if (pos + paras.get(0) == 0)
					cpvalue = "fi:" + paras.get(0);
			}
			
			if (!cpvalue.equals("")) cps.add(cpvalue);
		}
		String [] ret = new String[cps.size()];		
		return cps.toArray(ret);
	}
756821
String parseJsString(String jsStringLiteral) throws ParseException {
    valueMatcher.reset(jsStringLiteral);
    if (!valueMatcher.matches()) {
      throw new ParseException("Syntax error in JS String literal", true /* fatal */);
    }
    return valueMatcher.group(1) != null ? valueMatcher.group(1) : valueMatcher.group(2);
  }
590898
public Object parseValue() {
    Object val;
    switch(T.getType()) {
      case LCURLY:
        val = parseObject();
        break;
      case LSQUARE:
        val = parseArray();
        break;
      case INTEGER:
        if(useBig) {
          val = new BigInteger(T.getString());
        } else {
          try {
            val = Integer.parseInt(T.getString());
          } catch(NumberFormatException e0) {
            // we have an overflow, the tokenizer guarantees the format is correct
            try {
              val = Long.parseLong(T.getString());
            } catch(NumberFormatException e1) {
              val = 0;
            }
          }
        }
        advance();
        break;
      case DOUBLE:
        if(useBig) {
          val = new BigDecimal(T.getString());
        } else {
          val = Double.parseDouble(T.getString());
        }
        advance();
        break;
      case STRING:
        val = T.getString();
        advance();
        break;
      case TRUE:
        val = true;
        advance();
        break;
      case FALSE:
        val = false;
        advance();
        break;
      case NULL:
        val = null;
        advance();
        break;
      default:
        val = null;
        addError();
    }
    return val;
  }
1308108
public static Object getVariableEL(PageContext pc, String var, Object defaultValue) {
	StringList list = parse(pc, new ParserString(var), false);
	if (list == null) return defaultValue;

	int scope = scopeString2Int(pc.ignoreScopes(), list.next());
	Object coll = null;
	if (scope == Scope.SCOPE_UNDEFINED) {
	    coll = pc.undefinedScope().get(KeyImpl.init(list.current()), NullSupportHelper.NULL());
	    if (coll == NullSupportHelper.NULL()) return defaultValue;
	}
	else {
	    try {
		coll = VariableInterpreter.scope(pc, scope, list.hasNext());
		// coll=pc.scope(scope);
	    }
	    catch (PageException e) {
		return defaultValue;
	    }
	}

	while (list.hasNext()) {
	    coll = pc.getVariableUtil().get(pc, coll, KeyImpl.init(list.next()), NullSupportHelper.NULL());
	    if (coll == NullSupportHelper.NULL()) return defaultValue;
	}
	return coll;
    }
962193
@SuppressWarnings("squid:S1698")
    private Expression literalAtom() {
        if (tokenizer.current().isSymbol("+") && tokenizer.next().isNumber()) {
            // Parse numbers with a leading + sign like +2.02 by simply ignoring the +
            tokenizer.consume();
        }
        if (tokenizer.current().isNumber()) {
            double value = Double.parseDouble(tokenizer.consume().getContents());
            if (tokenizer.current().is(Token.TokenType.ID)) {
                String quantifier = tokenizer.current().getContents().intern();
                if ("n" == quantifier) {
                    value /= 1000000000d;
                    tokenizer.consume();
                } else if ("u" == quantifier) {
                    value /= 1000000d;
                    tokenizer.consume();
                } else if ("m" == quantifier) {
                    value /= 1000d;
                    tokenizer.consume();
                } else if ("K" == quantifier || "k" == quantifier) {
                    value *= 1000d;
                    tokenizer.consume();
                } else if ("M" == quantifier) {
                    value *= 1000000d;
                    tokenizer.consume();
                } else if ("G" == quantifier) {
                    value *= 1000000000d;
                    tokenizer.consume();
                } else {
                    Token token = tokenizer.consume();
                    errors.add(ParseError.error(token,
                                                String.format("Unexpected token: '%s'. Expected a valid quantifier.",
                                                              token.getSource())));
                }
            }
            return new Constant(value);
        }
        Token token = tokenizer.consume();
        errors.add(ParseError.error(token,
                                    String.format("Unexpected token: '%s'. Expected an expression.",
                                                  token.getSource())));
        return Constant.EMPTY;
    }
79044
@Override
    public OWLObject getValue() throws OWLException {
        try {
            return translate(ontopBinding.getValue());
        } catch (OntopResultConversionException e) {
            throw new OntopOWLException(e);
        }
    }
1299222
protected AIntLiteralExp getIntLiteral(long i)
	{
		AIntLiteralExp number = new AIntLiteralExp();
		ILexIntegerToken literal = new LexIntegerToken(i, null);
		number.setValue(literal);
		return number;
	}