Examples of factory()


Examples of st.gravel.support.compiler.ast.ArrayLiteralNode.factory()

  @Test
  public void testParseLiteralArray() {
    final ArrayLiteralNode _node;
    _node = ((ArrayLiteralNode) Parser.factory.source_("#(#foo foo \'foo\' 1 (a b c) #( a b c) ((x)) () #[1 2 3])").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), ArrayLiteralNode.factory));
    assertEquals((String) "#(#foo #foo \'foo\' 1 #(#a #b #c) #(#a #b #c) #(#(#x)) #() #[1 2 3])", (String) _node.prettySourceString());
    assertTrue(st.gravel.support.jvm.IntegerExtensions.equals_(_node.value().length, 9));
  }

  @Test
View Full Code Here

Examples of st.gravel.support.compiler.ast.BinaryMethodNode.factory()

  @Test
  public void testParseBinaryMethod() {
    final BinaryMethodNode _node;
    _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg ^bar"));
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory));
    assertEquals((String) "+ arg\n\t^bar", (String) _node.prettySourceString());
  }

  @Test
  public void testParseBinaryUnaryExpression() {
View Full Code Here

Examples of st.gravel.support.compiler.ast.BlockNode.factory()

  @Test
  public void testParse2ArgBlockEmpty1() {
    final BlockNode _node;
    _node = ((BlockNode) Parser.factory.source_("[:a :b  | ]").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory));
    assertEquals((String) "[:a :b | ]", (String) _node.prettySourceString());
  }

  @Test
  public void testParse2ArgBlockEmpty2() {
View Full Code Here

Examples of st.gravel.support.compiler.ast.ByteArrayLiteralNode.factory()

  @Test
  public void testParseByteArray() {
    final ByteArrayLiteralNode _node;
    _node = ((ByteArrayLiteralNode) Parser.factory.source_("#[1 2 3]").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), ByteArrayLiteralNode.factory));
    assertEquals((String) "#[1 2 3]", (String) _node.prettySourceString());
    assertTrue(st.gravel.support.jvm.ByteArrayExtensions.equals_(_node.value(), new byte[] { 1, 2, 3 }));
  }

  @Test
View Full Code Here

Examples of st.gravel.support.compiler.ast.CharacterLiteralNode.factory()

  @Test
  public void testParseChar() {
    final CharacterLiteralNode _node;
    _node = ((CharacterLiteralNode) Parser.factory.source_("$a").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), CharacterLiteralNode.factory));
    assertEquals((String) "$a", (String) _node.prettySourceString());
    assertTrue(st.gravel.support.jvm.CharacterExtensions.equals_(_node.value(), 'a'));
  }

  @Test
View Full Code Here

Examples of st.gravel.support.compiler.ast.DoubleLiteralNode.factory()

  @Test
  public void testParseDouble() {
    final DoubleLiteralNode _node;
    _node = ((DoubleLiteralNode) Parser.factory.source_("123412341345145145123412341234.003213123123d").parseExpression());
    assertEquals((st.gravel.support.jvm.SmalltalkFactory) DoubleLiteralNode.factory, (st.gravel.support.jvm.SmalltalkFactory) _node.factory());
    assertEquals((double) 1.2341234134515e29d, (double) _node.value(), (double) 1.0e16f);
  }

  @Test
  public void testParseDouble2() {
View Full Code Here

Examples of st.gravel.support.compiler.ast.FixedPointLiteralNode.factory()

  @Test
  public void testParseFixedPoint() {
    final FixedPointLiteralNode _node;
    _node = ((FixedPointLiteralNode) Parser.factory.source_("12345.0067s").parseExpression());
    assertEquals((st.gravel.support.jvm.SmalltalkFactory) FixedPointLiteralNode.factory, (st.gravel.support.jvm.SmalltalkFactory) _node.factory());
    assertEquals((String) "12345.0067s", (String) _node.valueString());
  }

  @Test
  public void testParseFixedPointNegativeWithExponent() {
View Full Code Here

Examples of st.gravel.support.compiler.ast.FloatLiteralNode.factory()

  @Test
  public void testParseFloat() {
    final FloatLiteralNode _node;
    _node = ((FloatLiteralNode) Parser.factory.source_("123412341345145145123412341234.003213123123").parseExpression());
    assertEquals((st.gravel.support.jvm.SmalltalkFactory) FloatLiteralNode.factory, (st.gravel.support.jvm.SmalltalkFactory) _node.factory());
    assertEquals((float) 123412341345145145123412341234.003213123123f, (float) _node.value(), (float) 0.000000001f);
  }

  @Test
  public void testParseFloat2() {
View Full Code Here

Examples of st.gravel.support.compiler.ast.IntegerLiteralNode.factory()

  @Test
  public void testParseHexInteger() {
    final IntegerLiteralNode _node;
    _node = ((IntegerLiteralNode) Parser.factory.source_("16rFF").parseExpression());
    assertEquals((st.gravel.support.jvm.SmalltalkFactory) IntegerLiteralNode.factory, (st.gravel.support.jvm.SmalltalkFactory) _node.factory());
    assertEquals(255, (int) _node.value());
  }

  @Test
  public void testParseInteger() {
View Full Code Here

Examples of st.gravel.support.compiler.ast.KeywordMethodNode.factory()

  @Test
  public void testParseKeywordMethod1() {
    final KeywordMethodNode _node;
    _node = ((KeywordMethodNode) Parser.factory.parseMethod_("foo: arg1 ^bar"));
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), KeywordMethodNode.factory));
    assertEquals((String) "foo: arg1\n\t^bar", (String) _node.prettySourceString());
  }

  @Test
  public void testParseKeywordMethod2() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.