13514
|
1 /*
|
|
2 * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. This
|
|
3 * code is released under a tri EPL/GPL/LGPL license. You can use it,
|
|
4 * redistribute it and/or modify it under the terms of the:
|
|
5 *
|
|
6 * Eclipse Public License version 1.0
|
|
7 * GNU General Public License version 2
|
|
8 * GNU Lesser General Public License version 2.1
|
|
9 */
|
|
10 package com.oracle.truffle.ruby.nodes;
|
|
11
|
|
12 import java.io.*;
|
|
13
|
|
14 import com.oracle.truffle.api.*;
|
|
15
|
|
16 /**
|
|
17 * Singleton source used for core method nodes.
|
|
18 */
|
|
19 public final class CoreSource implements Source {
|
|
20
|
|
21 private final String name;
|
|
22
|
|
23 public CoreSource(String name) {
|
|
24 this.name = name;
|
|
25 }
|
|
26
|
|
27 public String getName() {
|
|
28 return name;
|
|
29 }
|
|
30
|
|
31 public String getCode() {
|
|
32 return name;
|
|
33 }
|
|
34
|
|
35 @Override
|
|
36 public String toString() {
|
|
37 return name;
|
|
38 }
|
|
39
|
|
40 public String getPath() {
|
|
41 return null;
|
|
42 }
|
|
43
|
|
44 public Reader getReader() {
|
|
45 return null;
|
|
46 }
|
|
47
|
|
48 public InputStream getInputStream() {
|
|
49 return null;
|
|
50 }
|
|
51
|
|
52 public String getCode(int lineNumber) {
|
|
53 return null;
|
|
54 }
|
|
55
|
|
56 public int getLineCount() {
|
|
57 return 0;
|
|
58 }
|
|
59
|
|
60 public int getLineNumber(int offset) {
|
|
61 return 0;
|
|
62 }
|
|
63
|
|
64 public int getLineStartOffset(int lineNumber) {
|
|
65 return 0;
|
|
66 }
|
|
67
|
|
68 public int getLineLength(int lineNumber) {
|
|
69 return 0;
|
|
70 }
|
|
71
|
|
72 }
|